{"id":302,"date":"2010-03-27T13:59:25","date_gmt":"2010-03-27T13:59:25","guid":{"rendered":""},"modified":"2010-03-27T13:59:25","modified_gmt":"2010-03-27T13:59:25","slug":"302","status":"publish","type":"post","link":"https:\/\/www.poloo.org\/?p=302","title":{"rendered":"\u6700\u5e38\u7528\u768412\u79cdCSS BUG\u89e3\u51b3\u65b9\u6cd5\u4e0e\u6280\u5de7"},"content":{"rendered":"<p>\u3000\u3000CSS bug\u662f\u5e03\u5c40\u4e2d\u6700\u5934\u75bc\u7684\u95ee\u9898\u3002\u6211\u4eec\u9700\u8981\u517c\u987e\u5404\u79cd\u6d4f\u89c8\u5668\uff0c\u4ee5\u671f\u5f85\u83b7\u5f97\u4e00\u81f4\u7684\u6548\u679c\u3002\u975e\u5e38\u9057\u61be\u7684\u662f\u5404\u5382\u5546\u4e4b\u95f4\u7684\u7ade\u4e89\u5bfc\u81f4\u5f88\u591a\u95ee\u9898\u7684\u5b58\u5728\u3002\u800cIE6\u4e0eIE7\u5728\u5f88\u591a\u95ee\u9898\u4e0a\u4e5f\u5b58\u5728\u7740\u5f88\u5927\u7684\u5dee\u522b\u3002\u8f7b\u677e\u7684\u89e3\u51b3CSS bug\u662f\u6211\u4eec\u5fc5\u987b\u638c\u63e1\u7684\u6280\u80fd\u3002\u73b0\u5728\u6574\u7406\u51fa\u6700\u5e38\u7528\u768412\u79cdCSS BUG\u89e3\u51b3\u65b9\u6cd5\u4ee5\u53caCSS BUG\u7c7b\u7684\u5c0f\u6280\u5de7\u3002\u5e0c\u671b\u5bf9\u60a8\u7684\u5b66\u4e60\u3001\u5de5\u4f5c\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<p>\u4e00\u3001 \u9488\u5bf9\u6d4f\u89c8\u5668\u7684\u9009\u62e9\u5668<\/p>\n<p>\u3000\u3000\u8fd9\u4e9b\u9009\u62e9\u5668\u5728\u4f60\u9700\u8981\u9488\u5bf9\u67d0\u6b3e\u6d4f\u89c8\u5668\u8fdb\u884ccss\u8bbe\u8ba1\u65f6\u5c06\u975e\u5e38\u6709\u7528.<br \/>\u3000\u3000IE6\u53ca\u5176\u66f4\u4f4e\u7248\u672c\uff01<br \/>\u3000\u3000* html {}<br \/>\u3000\u3000IE7\u53ca\u5176\u66f4\u4f4e\u7248\u672c<br \/>\u3000\u3000*:first-child+html {} * html {}<br \/>\u3000\u3000\u4ec5\u9488\u5bf9IE7<br \/>\u3000\u3000*:first-child+html {}<br \/>\u3000\u3000IE7\u548c\u5f53\u4ee3\u6d4f\u89c8\u5668<br \/>\u3000\u3000html&gt;body{}<br \/>\u3000\u3000\u4ec5\u5f53\u4ee3\u6d4f\u89c8\u5668(IE7\u4e0d\u9002\u7528)<br \/>\u3000\u3000html&gt;\/**\/body{}<br \/>\u3000\u3000Opera9\u53ca\u5176\u66f4\u4f4e\u7248\u672c<br \/>\u3000\u3000html:first-child {}<br \/>\u3000\u3000Safari<br \/>\u3000\u3000html[xmlns*=&#8221;&#8221;] body:last-child {}<br \/>\u3000\u3000\u8981\u4f7f\u7528\u8fd9\u4e9b\u9009\u62e9\u5668,\u8bf7\u5c06\u5b83\u4eec\u653e\u5728\u6837\u5f0f\u4e4b\u524d. \u4f8b\u5982:<\/p>\n<p>#content-box { <br \/>width: 300px; <br \/>height: 150px; <br \/>} <\/p>\n<p>* html #content-box { <br \/>width: 250px; <br \/>} <\/p>\n<p>\u3000\u3000\u60a8\u4e5f\u53ef\u4ee5\u53c2\u8003\u2014CSS hacks\uff1a\u6d4f\u89c8\u5668\u7279\u5b9a\u9009\u62e9\u5668\u4ecb\u7ecd<br \/><a href=\"http:\/\/www.poloo.org\/?p=267\" target=\"_blank\" rel=\"external\">http:\/\/www.poloo.org\/?p=267<\/a><\/p>\n<p>\u4e8c\u3001\u8ba9IE6\u652f\u6301PNG\u900f\u660e<\/p>\n<p>\u3000\u3000\u4e00\u4e2aIE6\u7684Bug\u5f15\u8d77\u4e86\u5927\u9ebb\u70e6, \u4ed6\u4e0d\u652f\u6301\u900f\u660e\u7684PNG\u56fe\u7247\u3002<br \/>\u3000\u3000\u4f60\u9700\u8981\u4f7f\u7528\u4e00\u4e2acss\u6ee4\u955c<\/p>\n<p>*html #image-style { <br \/>background-image: none; <br \/>filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=&#8221;fil <br \/>ename.png&#8221;, sizingMethod=&#8221;scale&#8221;); <br \/>}<\/p>\n<p>\u4e09\u3001\u79fb\u9664\u8d85\u94fe\u63a5\u7684\u865a\u7ebf<\/p>\n<p>\u3000\u3000FireFox\u4e0b,\u5f53\u4f60\u70b9\u51fb\u4e00\u4e2a\u8d85\u94fe\u63a5\u65f6\u4f1a\u5728\u5916\u56f4\u51fa\u73b0\u4e00\u4e2a\u865a\u7ebf\u8f6e\u5ed3. \u8fd9\u5f88\u5bb9\u6613\u89e3\u51b3, \u53ea\u9700\u8981\u5728\u6807\u7b7e\u6837\u5f0f\u4e2d\u52a0\u5165\u3002<\/p>\n<p>outline:none.<br \/>a{ <br \/>outline: none; <br \/>}<\/p>\n<p>\u3000\u3000\u60a8\u4e5f\u53ef\u4ee5\u53c2\u8003\u2014\u9664\u94fe\u63a5\u5143\u7d20\u7684\u865a\u7ebf\u6846\uff08\u517c\u5bb9IE7\u3001IE6\u3001FF\uff09<br \/>\u3000\u3000<a href=\"http:\/\/www.poloo.org\/?p=298\" target=\"_blank\" rel=\"external\">http:\/\/www.poloo.org\/?p=298<\/a><\/p>\n<p>\u56db\u3001\u7ed9\u884c\u5185\u5143\u7d20\u5b9a\u4e49\u5bbd\u5ea6<\/p>\n<p>\u3000\u3000\u5982\u679c\u4f60\u7ed9\u4e00\u4e2a\u884c\u5185\u5143\u7d20\u5b9a\u4e49\u5bbd\u5ea6,\u90a3\u4e48\u5b83\u53ea\u662f\u5728IE6\u4e0b\u6709\u6548. \u6240\u6709\u7684HTML\u5143\u7d20\u8981\u4e48\u662f\u884c\u5185\u5143\u7d20\u8981\u4e48\u5c31\u597d\u662f\u5757\u5143\u7d20. \u884c\u5185\u5143\u7d20\u5305\u62ec: &lt;span&gt;, &lt;a&gt;, &lt;strong&gt; \u548c &lt;em&gt;. \u5757\u5143\u7d20\u5305\u62ec&lt;div&gt;, &lt;p&gt;, &lt;h1&gt;, &lt;form&gt;\u548c&lt;li&gt; . \u4f60\u4e0d\u80fd\u5b9a\u4e49\u884c\u5185\u5143\u7d20\u7684\u5bbd\u5ea6, \u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u4f60\u53ef\u4ee5\u5c06\u884c\u5185\u5143\u7d20\u8f6c\u53d8\u4e3a\u5757\u5143\u7d20.<\/p>\n<p>span { width: 150px; display: block }<\/p>\n<p>\u4e94\u3001\u8ba9\u56fa\u5b9a\u5bbd\u5ea6\u7684\u9875\u9762\u5c45\u4e2d<\/p>\n<p>\u3000\u3000\u4e3a\u4e86\u8ba9\u9875\u9762\u5728\u6d4f\u89c8\u5668\u5c45\u4e2d\u663e\u793a, \u9700\u8981\u76f8\u5bf9\u5b9a\u4f4d\u5916\u5c42div, \u7136\u540e\u628amargin\u8bbe\u7f6e\u4e3aauto.<\/p>\n<p>#wrapper { <br \/>margin: auto; <br \/>position: relative; <br \/>}<\/p>\n<p>\u516d\u3001IE6\u53cc\u500d\u8fb9\u8ddd\u7684bug<\/p>\n<p>\u3000\u3000\u7ed9\u6b64\u5bf9\u8c61\u52a0\u4e0adisplay:inline\u5373\u53ef\u89e3\u51b3\u95ee\u9898\u3002\u5177\u4f53\u4ecb\u7ecd\uff1a<br \/>\u3000\u3000<a href=\"http:\/\/www.poloo.org\/?p=299\" target=\"_blank\" rel=\"external\">http:\/\/www.poloo.org\/?p=299<\/a><\/p>\n<p>\u4e03\u3001Box Model \u76d2\u6a21\u578bbug\u7684\u4e00\u822c\u89e3\u51b3\u529e\u6cd5<\/p>\n<p>\u3000\u3000\u8fd9\u662f\u4e00\u4e2a\u81ed\u540d\u662d\u8457\u7684\u95ee\u9898\u4e86\uff0c\u8be6\u60c5\u53c2\u8003\u8fd9\u91cc\uff1a<br \/>\u3000\u3000<a href=\"http:\/\/www.poloo.org\/default.asp?id=300\" target=\"_blank\" rel=\"external\">http:\/\/www.poloo.org\/default.asp?id=300<\/a><\/p>\n<p>\u516b\u3001\u4e24\u4e2a\u5c42\u4e4b\u95f4\u76843px\u95f4\u9699<\/p>\n<p>\u3000\u3000\u4f20\u8bf4\u4e2d\u7684\u201cIE 3px bug\u201d\uff0c\u89e3\u51b3\u7684\u529e\u6cd5\uff1a<br \/>\u3000\u3000<a href=\"http:\/\/www.poloo.org\/?p=301\" target=\"_blank\" rel=\"external\">http:\/\/www.poloo.org\/?p=301<\/a><\/p>\n<p>\u4e5d\u3001\u5728IE\u4e2d\u7684HTML\u6ce8\u91ca\u5f15\u8d77\u6587\u5b57\u5947\u602a\u7684\u590d\u5236<\/p>\n<p>\u3000\u3000Duplicate Characters Bug\u5f88\u795e\u5947\uff0c\u5177\u4f53\u7684\u89e3\u51b3\u529e\u6cd5\uff1a<br \/>\u3000\u3000<a href=\"http:\/\/www.poloo.org\/?p=291\" target=\"_blank\" rel=\"external\">http:\/\/www.poloo.org\/?p=291<\/a><\/p>\n<p>\u5341\u3001\u56fe\u7247\u66ff\u6362\u6280\u672f<\/p>\n<p>\u3000\u3000\u7528\u6587\u5b57\u603b\u6bd4\u7528\u56fe\u7247\u505a\u6807\u9898\u597d\u4e00\u4e9b. \u6587\u5b57\u5bf9\u5c4f\u5e55\u9605\u8bfb\u673a\u548cSEO\u90fd\u662f\u975e\u5e38\u53cb\u597d\u7684.<\/p>\n<p>HTML:<br \/>&lt;h1&gt;&lt;span&gt;Main heading one&lt;\/span&gt;&lt;\/h1&gt;<br \/>CSS:<br \/>h1 { background: url(heading-image.gif) no-repeat; } <br \/>h1 span { <br \/>position:absolute; <br \/>text-indent: -5000px; <br \/>} <\/p>\n<p>\u3000\u3000\u4f60\u53ef\u4ee5\u770b\u5230\u6211\u4eec\u5bf9\u6807\u9898\u4f7f\u7528\u4e86\u6807\u51c6\u7684&lt;h1&gt;\u4f5c\u4e3a\u6807\u7b7e\u5e76\u4e14\u7528css\u6765\u5c06\u6587\u672c\u66ff\u6362\u4e3a\u56fe\u7247. text-indent\u5c5e\u6027\u5c06\u6587\u5b57\u63a8\u5230\u4e86\u6d4f\u89c8\u5668\u5de6\u8fb95000px\u5904, \u8fd9\u6837\u5bf9\u4e8e\u6d4f\u89c8\u8005\u6765\u8bf4\u5c31\u770b\u4e0d\u89c1\u4e86.<br \/>\u3000\u3000\u5173\u6389css,\u7136\u540e\u770b\u770b\u5934\u90e8\u4f1a\u662f\u4ec0\u4e48\u6837\u5b50\u7684.<\/p>\n<p>\u5341\u4e00\u3001 \u6700\u5c0f\u5bbd\u5ea6<\/p>\n<p>\u3000\u3000IE6\u53e6\u5916\u4e00\u4e2abug\u5c31\u662f\u5b83\u4e0d\u652f\u6301 min-width \u5c5e\u6027. min-width\u53c8\u662f\u76f8\u5f53\u6709\u7528\u7684, \u7279\u522b\u662f\u5bf9\u4e8e\u5f39\u6027\u6a21\u677f\u6765\u8bf4, \u5b83\u4eec\u6709\u4e00\u4e2a100%\u7684\u5bbd\u5ea6,min-width \u53ef\u4ee5\u544a\u8bc9\u6d4f\u89c8\u5668\u4f55\u65f6\u5c31\u4e0d\u8981\u518d\u538b\u7f29\u5bbd\u5ea6\u4e86.<br \/>\u9664IE6\u4ee5\u5916\u6240\u6709\u7684\u6d4f\u89c8\u5668\u4f60\u53ea\u9700\u8981\u4e00\u4e2a min-width: Xpx; \u4f8b\u5982:<\/p>\n<p>.container { <br \/>min-width:300px; <br \/>}<\/p>\n<p>\u3000\u3000\u4e3a\u4e86\u8ba9\u4ed6\u5728IE6\u4e0b\u5de5\u4f5c, \u6211\u4eec\u9700\u8981\u4e00\u4e9b\u989d\u5916\u7684\u5de5\u4f5c. \u5f00\u59cb\u7684\u65f6\u5019\u6211\u4eec\u9700\u8981\u521b\u5efa\u4e24\u4e2adiv, \u4e00\u4e2a\u5305\u542b\u53e6\u4e00\u4e2a:<\/p>\n<p>&lt;div class=&#8221;container&#8221;&gt; <br \/>&lt;div class=&#8221;holder&#8221;&gt;Content&lt;\/div&gt; <br \/>&lt;\/div&gt;<\/p>\n<p>\u3000\u3000\u7136\u540e\u4f60\u9700\u8981\u5b9a\u4e49\u5916\u5c42div\u7684min-width\u5c5e\u6027\uff01<\/p>\n<p>.container { <br \/>min-width:300px; <br \/>}<\/p>\n<p>\u8fd9\u65f6\u8be5\u662fIE hack\u5927\u663e\u8eab\u624b\u7684\u65f6\u5019\u4e86. \u4f60\u9700\u8981\u5305\u542b\u5982\u4e0b\u7684\u4ee3\u7801:<\/p>\n<p>* html .container { <br \/>border-right: 300px solid #FFF; <br \/>} <br \/>* html .holder { <br \/>display: inline-block; <br \/>position: relative; <br \/>margin-right: -300px; <br \/>}<\/p>\n<p>\u3000\u3000As the browser window is resized the outer div width reduces to suit until it shrinks to the border width, at which point it will not shrink any further. The holder div follows suit and also stops shrinking. The outer div border width becomes the minimum width of the inner div.<\/p>\n<p>\u5341\u4e8c\u3001\u9690\u85cf\u6c34\u5e73\u6eda\u52a8\u6761<\/p>\n<p>\u3000\u3000\u4e3a\u4e86\u907f\u514d\u51fa\u73b0\u6c34\u5e73\u6eda\u52a8\u6761, \u5728body\u91cc\u52a0\u5165 overflow-x:hidden .<\/p>\n<p>body { overflow-x: hidden; }<\/p>\n<p>\u3000\u3000\u5f53\u4f60\u51b3\u5b9a\u4f7f\u7528\u4e00\u4e2a\u6bd4\u6d4f\u89c8\u5668\u7a97\u53e3\u5927\u7684\u56fe\u7247\u6216\u8005flash\u65f6, \u8fd9\u4e2a\u6280\u5de7\u5c06\u975e\u5e38\u6709\u7528.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u3000CSS bug\u662f\u5e03\u5c40\u4e2d\u6700\u5934\u75bc\u7684\u95ee\u9898\u3002\u6211\u4eec\u9700\u8981\u517c\u987e\u5404\u79cd\u6d4f\u89c8\u5668\uff0c\u4ee5\u671f&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-302","post","type-post","status-publish","format-standard","hentry","category-Dream"],"_links":{"self":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=302"}],"version-history":[{"count":0,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/302\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}