{"id":134,"date":"2013-05-21T14:59:32","date_gmt":"2013-05-21T06:59:32","guid":{"rendered":"http:\/\/www.zyuns.com\/?p=134"},"modified":"2015-02-15T21:00:22","modified_gmt":"2015-02-15T13:00:22","slug":"134","status":"publish","type":"post","link":"https:\/\/www.siediyer.cn\/?p=134","title":{"rendered":"IE6,7\u9ed8\u8ba4\u663e\u793a\u5782\u76f4\u6eda\u52a8\u6761"},"content":{"rendered":"<div>\n<h2 id=\"t_4a4b1b010100ubhr\">IE6,7\u9ed8\u8ba4\u663e\u793a\u5782\u76f4\u6eda\u52a8\u6761<\/h2>\n<\/div>\n<div id=\"sina_keyword_ad_area2\">IE6,7\u9ed8\u8ba4\u663e\u793a\u5782\u76f4\u6eda\u52a8\u6761,IE8\u4e0d\u663e\u793a\u5782\u76f4\u6eda\u52a8\u6761&nbsp;<\/p>\n<div><\/div>\n<div>\n<pre class=\"lang:default decode:true\">&lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\"&gt;\n&lt;html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"&gt;\n&lt;head&gt;\n&lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=gb2312\" \/&gt;\n&lt;title&gt;\u65e0\u6807\u9898\u6587\u6863&lt;\/title&gt;\n&lt;style&gt;\nbody{ margin:0px;}\n*{ margin:0px; padding:0px;}\n#center{\nmargin:0px auto;\nwidth:400px;\nheight:200px;\nline-height:200px;\nbackground:#f00;\ntext-align:center;\n}\n&lt;\/style&gt;\n&lt;\/head&gt;\n\n&lt;body&gt;\n\n&lt;div id=\"center\"&gt;&lt;p&gt;test content&lt;\/p&gt;&lt;\/div&gt;\n\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<div>\u663e\u793a\u7ed3\u679c&nbsp;<\/p>\n<div>\u8fd9\u6837\u9020\u6210\u7684\u7ed3\u679c\u5c31\u662f\u540c\u65f6\u6d4bIE6 7 8\u65f6\u4f1a\u51fa\u73b0\u8df3\u4e00\u4e0b<\/div>\n<div><\/div>\n<div>\u641c\u72d7\u6d4f\u89c8\u5668\u7528\u7684\u662fIE\u548cwebkit\u53cc\u5185\u6838\uff0c\u4f46\u5728IE\u5185\u6838\u4e0b\uff08\u7cfb\u7edf\u88c5IE8\u6d4f\u89c8\u5668\uff09\uff0c\u786e\u4e5f\u663e\u793a\u4e86\u5782\u76f4\u6eda\u52a8\u6761\uff0c\u662f\u4e2a\u5f88\u8ba8\u538c\u7684\u4e8b\u60c5\uff0c\u52a0\u4e86html {overflow:auto;}\u4e4b\u540e\uff0c\u5782\u76f4\u6eda\u52a8\u6761\u4e5f\u53bb\u6389\u4e86<\/div>\n<div>\u53bb\u6389IE6 7\u5782\u76f4\u6eda\u52a8\u6761\u7684\u65b9\u6cd5\uff1a<\/div>\n<div>\u5728\u6837\u5f0f\u4e2d\u6dfb\u52a0<\/div>\n<pre class=\"wrap:true lang:default decode:true\">html {overflow:auto;}\n&lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\"&gt;\n&lt;html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"&gt;\n&lt;head&gt;\n&lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=gb2312\" \/&gt;\n&lt;title&gt;\u65e0\u6807\u9898\u6587\u6863&lt;\/title&gt;\n&lt;style&gt;\nhtml {overflow:auto;}\nbody{ margin:0px;}\n*{ margin:0px; padding:0px;}\n#center{\nmargin:0px auto;\nwidth:400px;\nheight:200px;\nline-height:200px;\nbackground:#f00;\ntext-align:center;\n}\n&lt;\/style&gt;\n&lt;\/head&gt;\n\n&lt;body&gt;\n\n&lt;div id=\"center\"&gt;&lt;p&gt;test content&lt;\/p&gt;&lt;\/div&gt;\n\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n<p>&nbsp;<\/p>\n<div>\n<div>\u6dfb\u52a0html {overflow:auto;}\u4ee5\u540e\uff0c\u5782\u76f4\u6eda\u52a8\u6761\u5c31\u53bb\u6389\u4e86<\/div>\n<div><\/div>\n<div>\n<p>\u4ee5\u524d\u8bf4\u7684\u65b9\u6cd5\u5982\u4e0b:<br \/>\n&lt;body scroll=&#8221;no&#8221;&gt; \u8fd9\u4e2a\u65b9\u6cd5\u662f\u4e0d\u6807\u51c6\u7684.\u00a0<wbr \/> body\u91cc\u6ca1\u6709\u8fd9\u4e2a\u5c5e\u6027.<br \/>\n\u6b63\u786e\u65b9\u6cd5:\u00a0<wbr \/><br \/>\n<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/> \u8fd9\u4e2a\u53ef\u4ee5\u53bb\u6389IE6,7\u7684\u6eda\u52a8<\/p>\n<pre class=\"wrap:true lang:default decode:true \">               html {\n                   overflow:auto;\n                }\n\n               \u8fd9\u4e2a\u53ef\u53bb\u6389IE5.5\u7684\u6eda\u52a8\n               body {\n                    overflow:auto;\n               }<\/pre>\n<p>&nbsp;<\/p>\n<p>\u73b0\u5728\u662f\u53bb\u6389IE6\u7684:<\/p>\n<p>\u6b63\u786e\u65b9\u6cd5:\u00a0<wbr \/><br \/>\n<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/>\u00a0<wbr \/><\/p>\n<pre class=\"wrap:true lang:default decode:true \">               html {\n                   overflow:auto;\n                   _overflow-x:hidden;\n                }\n\n               body {\n                    overflow:auto;\n                    _margin-left:-8px;\n               }<\/pre>\n<p>&nbsp;<\/p>\n<p>\u5982\u679c\uff0c\u4f60\u7684\u9875\u9762\u4e0a\u4f7f\u7528\u4e86frame\u6216\u8005iframe\uff0c\u4f7f\u7528IE6\u6d4f\u89c8\uff0c\u5c06\u53ef\u80fd\u51fa\u73b0\u975e\u5e38\u4e0d\u7f8e\u89c2\u7684\u6a2a\u5411\u6eda\u52a8\u6761\u3002\u90a3\u4e48\u4f60\u6709\u53ef\u80fd\u4f1a\u4f7f\u7528 scrolling=&#8221;no&#8221;\u8fd9\u4e2a\u5c5e\u6027\uff0c\u4f46\u8fd9\u6837\u8bb2\u4f1a\u5bfc\u81f4\u8fde\u7ad6\u5411\u7684\u6eda\u52a8\u6761\u90fd\u4e0d\u89c1\u4e86\u3002\u597d\uff0c\u90a3\u4e5f\u6709\u53ef\u80fd\u5728body\u6807\u7b7e\u6216css\u91cc\u9762\u5b9a\u4e49overflow-x: hidden; overflow-y: auto;\u8fd9\u4e24\u4e2a\u53c2\u6570\uff0c\u4f46\u662f\u4ecd\u65e7\u90a3\u8ba8\u538c\u7684\u6a2a\u5411\u6eda\u52a8\u6761\u8fd8\u5728\u3002<br \/>\n\u8fd9\u662f\u4e3a\u4ec0\u4e48\u5462\uff1f\u539f\u6765\uff0c\u5728\u7528IE6\u6d4f\u89c8\u6709\u6846\u67b6\u7684XHTML\u9875\u9762\u7684\u65f6\u5019\uff0c\u9ed8\u8ba4\u4f1a\u6c34\u5e73\u548c\u5782\u76f4\u6eda\u52a8\u6761\u4f1a\u4e00\u8d77\u51fa\u73b0\uff0c\u8fd9\u662fIE6\u7684\u4e00\u4e2a\u6f0f\u6d1e\uff0c\u4f60\u5728Firefox\u4e0a\u6d4f\u89c8\u4f60\u7684\u7f51\u7ad9\u662f\u6b63\u5e38\u7684\uff0c\u800cIE6\u5bf9XHTML 1.0 Transitional DOCTYPE\u7684\u89e3\u91ca\u7f3a\u9677.<\/p>\n<p>\u6211\u4ece\u4e2d\u627e\u5230\u4e86\u4e00\u4e0b\u4e09\u79cd\u4e0d\u4ec5\u89e3\u51b3\u4e86\u8fd9\u4e2a\u95ee\u9898\uff0c\u800c\u4e14\u4f60\u7684\u9875\u9762\u7528XHTML 1.0 Transitional \u58f0\u660e\u4e5f\u6ca1\u95ee\u9898\u7684\u65b9\u6cd5\u3002<\/p>\n<div>\n<div>\u65b9\u6cd51:&nbsp;<\/p>\n<div>\n<pre class=\"lang:default decode:true \">html { overflow-y: scroll; }<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<p>\u539f\u7406\uff1a\u5f3a\u5236\u663e\u793aie\u7684\u5782\u76f4\u6eda\u52a8\u6761\uff0c\u800c\u5ffd\u7565\u6c34\u5e73\u6eda\u52a8\u6761<br \/>\n\u4f18\u70b9\uff1a\u5b8c\u5168\u89e3\u51b3\u4e86\u8fd9\u4e2a\u95ee\u9898, \u5141\u8bb8\u4f60\u4fdd\u6301\u5b8c\u6574\u7684XHTML doctype.<br \/>\n\u7f3a\u70b9\uff1a\u5373\u4f7f\u9875\u9762\u4e0d\u9700\u8981\u5782\u76f4\u6eda\u52a8\u6761\u7684\u65f6\u5019\u4e5f\u4f1a\u51fa\u73b0\u5782\u76f4\u6eda\u52a8\u6761\u3002<\/p>\n<p>\u65b9\u6cd52:<\/p>\n<div>\n<pre class=\"lang:default decode:true \">html { overflow-x: hidden; overflow-y: auto; }<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<p>\u539f\u7406\uff1a\u9690\u85cf\u6a2a\u5411\u6eda\u52a8\uff0c\u5782\u76f4\u6eda\u52a8\u6839\u636e\u5185\u5bb9\u81ea\u9002\u5e94<br \/>\n\u4f18\u70b9\uff1a\u5728\u89c6\u89c9\u4e0a\u89e3\u51b3\u4e86\u8fd9\u4e2a\u95ee\u9898.\u5728\u4e0d\u5fc5\u8981\u7684\u65f6\u5019, \u672a\u5f3a\u5236\u5782\u76f4\u6eda\u52a8\u6761\u51fa\u73b0.<br \/>\n\u7f3a\u70b9\uff1a\u53ea\u662f\u9690\u85cf\u4e86\u6c34\u5e73\u6eda\u52a8\u6761\uff0c\u5982\u679c\u9875\u9762\u771f\u6b63\u9700\u8981\u6c34\u5e73\u6eda\u52a8\u6761\u7684\u65f6\u5019\uff0c<br \/>\n\u5c4f\u5e55\u4ee5\u5916\u7684\u5185\u5bb9\u4f1a\u56e0\u4e3a\u7528\u6237\u65e0\u6cd5\u6c34\u5e73\u6eda\u52a8\uff0c\u800c\u770b\u4e0d\u5230\u3002<\/p>\n<p>\u65b9\u6cd53:<\/p>\n<div>\n<pre class=\"lang:default decode:true \">body { margin-right: -15px; margin-bottom: -15px; }<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<p>\u539f\u7406\uff1a\u8fd9\u4f1a\u5728margin\u7684\u6c34\u5e73\u548c\u5782\u76f4\u65b9\u5411\u4e0a\u6dfb\u52a0\u4e00\u4e2a\u8d1f\u503c, IE\u6dfb\u52a0\u4e86\u8be5\u7cbe\u786e\u6570\u503c\u540e, \u4fbf\u4f1a\u53bb\u9664\u5bf9\u6eda\u52a8\u6761\u7684\u9700\u6c42\u5047\u8c61.<br \/>\n\u4f18\u70b9\uff1a\u5728\u89c6\u89c9\u4e0a\u89e3\u51b3\u4e86\u8fd9\u4e2a\u95ee\u9898.\uff0c\u5782\u76f4\u6eda\u52a8\u6839\u636e\u5185\u5bb9\u81ea\u9002\u5e94<br \/>\n\u7f3a\u70b9\uff1a\u7531\u4e8e&#8221;\u4eba\u4e3a\u521b\u5efa&#8221;\u4e8615px\u7684\u5916\u8fb9\u8ddd(margin), \u6240\u4ee5\u65e0\u6cd5\u4f7f\u7528\u8be5\u586b\u5145\u8fc7\u7684\u5c4f\u5e55\u533a\u57df<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>IE6,7\u9ed8\u8ba4\u663e\u793a\u5782\u76f4\u6eda\u52a8\u6761 IE6,7\u9ed8\u8ba4\u663e\u793a\u5782\u76f4\u6eda\u52a8\u6761,IE8\u4e0d\u663e\u793a\u5782\u76f4\u6eda\u52a8\u6761&nbsp; &lt;!DO [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-134","post","type-post","status-publish","format-standard","hentry","category-javascript"],"_links":{"self":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts\/134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=134"}],"version-history":[{"count":1,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts\/134\/revisions"}],"predecessor-version":[{"id":486,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts\/134\/revisions\/486"}],"wp:attachment":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}