{"id":99,"date":"2011-02-17T13:23:00","date_gmt":"2011-02-17T05:23:00","guid":{"rendered":"http:\/\/gaigaiming.com\/?p=99"},"modified":"2011-02-17T13:23:00","modified_gmt":"2011-02-17T05:23:00","slug":"%e5%b8%b8%e7%94%a8%e7%9a%8410%e7%a7%8dcss-bug%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95%e4%b8%8e%e6%8a%80%e5%b7%a7-%e6%b5%8f%e8%a7%88%e5%99%a8%e5%85%bc%e5%ae%b9%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.gaigaiming.com\/index.php\/2011\/02\/17\/%e5%b8%b8%e7%94%a8%e7%9a%8410%e7%a7%8dcss-bug%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95%e4%b8%8e%e6%8a%80%e5%b7%a7-%e6%b5%8f%e8%a7%88%e5%99%a8%e5%85%bc%e5%ae%b9%e6%95%99%e7%a8%8b\/","title":{"rendered":"\u5e38\u7528\u768410\u79cdCSS BUG\u89e3\u51b3\u65b9\u6cd5\u4e0e\u6280\u5de7-\u6d4f\u89c8\u5668\u517c\u5bb9\u6559\u7a0b"},"content":{"rendered":"<div> &nbsp;<\/p>\n<p><p>CSS 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<br \/>\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<br \/>\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<br \/>\u5e0c\u671b\u5bf9\u60a8\u7684\u5b66\u4e60\u3001\u5de5\u4f5c\u6709\u6240\u5e2e\u52a9\uff0c\u5982\u679c\u60a8\u4f9d\u7136\u6709\u7591\u95ee\uff0c<\/p>\n<p><strong>\u4e00\u3001 \u9488\u5bf9\u6d4f\u89c8\u5668\u7684\u9009\u62e9\u5668<\/strong><\/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<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*=&quot;&quot;] 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><img decoding=\"async\" alt=\"div css xhtml xml Example Source Code\" src=\"\/album\/pic\/item\/91ae743582b0391d241f14db.jpg\" \/> Example Source Code#content-box { <br \/>width: 300px; <br \/>height: 150px; <br \/>}<br \/><img decoding=\"async\" alt=\"div css xhtml xml Example Source Code\" src=\"\/album\/pic\/item\/fbbb054f32a59c99d0c86adb.jpg\" \/> Example Source Code * html #content-box { <br \/>width: 250px; <br \/>}<\/p>\n<p><strong>\u4e8c\u3001\u8ba9IE6\u652f\u6301PNG\u900f\u660e<\/strong><\/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><img decoding=\"async\" alt=\"div css xhtml xml Example Source Code\" src=\"\/album\/pic\/item\/49aea0cbc872aed5c81768db.jpg\" \/> Example Source Code*html #image-style { <br \/>background-image: none; <br \/>filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=&quot;fil <br \/>ename.png&quot;, sizingMethod=&quot;scale&quot;); <br \/>}<br \/><strong>\u4e09\u3001\u79fb\u9664\u8d85\u94fe\u63a5\u7684\u865a\u7ebf<\/strong><\/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\uff1a<\/p>\n<p><img decoding=\"async\" alt=\"div css xhtml xml Example Source Code\" src=\"\/album\/pic\/item\/bd799287d2ad766d66096edb.jpg\" \/> Example Source Codeoutline:none.<br \/>a{ <br \/>outline: none; <br \/>}\u5f88\u5b9e\u7528<\/p>\n<p><strong>\u56db\u3001\u7ed9\u884c\u5185\u5143\u7d20\u5b9a\u4e49\u5bbd\u5ea6<\/strong><\/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><img decoding=\"async\" alt=\"div css xhtml xml Example Source Code\" src=\"\/album\/pic\/item\/0bb8fc3c6f7532949e3d62db.jpg\" \/> Example Source Code span { width: 150px; display: block }<br \/><strong>\u4e94\u3001\u8ba9\u56fa\u5b9a\u5bbd\u5ea6\u7684\u9875\u9762\u5c45\u4e2d<\/strong><\/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><img decoding=\"async\" alt=\"div css xhtml xml Example Source Code\" src=\"\/album\/pic\/item\/f38ccdddf2bab3f2cc1166db.jpg\" \/> Example Source Code#wrapper { <br \/>margin: auto; <br \/>position: relative; <br \/>}margin:0 auto;\u8fd9\u4e2a\u4e5f\u53ef\u4ee5 \u8fd8\u6709 text-aglin\uff1acenter\uff1b\u4e3a\u4e86\u706b\u72d0\u548cIE\u517c\u5bb9<br \/><strong>\u4e03\u3001IE6\u53cc\u500d\u8fb9\u8ddd\u7684bug<\/strong><\/p>\n<p>\u3000\u3000\u7ed9\u6b64\u5bf9\u8c61\u52a0\u4e0adisplay:inline\u5373\u53ef\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n<p><strong>\u516b\u3001\u56fe\u7247\u66ff\u6362\u6280\u672f<\/strong><\/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><img decoding=\"async\" alt=\"div css xhtml xml Example Source Code\" src=\"\/album\/pic\/item\/bdb18fa0e8ab7bd8461064db.jpg\" \/> Example Source CodeHTML:<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 \/>}<br \/>\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><strong>\u4e5d\u3001 \u6700\u5c0f\u5bbd\u5ea6<\/strong><\/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><img decoding=\"async\" alt=\"div css xhtml xml Example Source Code\" src=\"\/album\/pic\/item\/a1a0478a60aab041c9fc7adb.jpg\" \/> Example Source Code.container { <br \/>min-width:300px; <br \/>}<br \/>\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><img decoding=\"async\" alt=\"div css xhtml xml Example Source Code\" src=\"\/album\/pic\/item\/2ba18c13e146ca9dc2fd78db.jpg\" \/> Example Source Code &lt;div class=&quot;container&quot;&gt; <br \/>&lt;div class=&quot;holder&quot;&gt;Content&lt;\/div&gt; <br \/>&lt;\/div&gt;<br \/>\u3000\u3000\u7136\u540e\u4f60\u9700\u8981\u5b9a\u4e49\u5916\u5c42div\u7684min-width\u5c5e\u6027\uff0c<br \/><img decoding=\"async\" alt=\"div css xhtml xml Example Source Code\" src=\"\/album\/pic\/item\/a44df6cfe847f55093457edb.jpg\" \/> Example Source Code .container { <br \/>min-width:300px; <br \/>}<br \/>\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><img decoding=\"async\" alt=\"div css xhtml xml Example Source Code\" src=\"\/album\/pic\/item\/af4cc902bfffdfdbd53f7cdb.jpg\" \/> Example Source Code* html .container { <br \/>border-right: 300px solid #FFF; <br \/>} <br \/>* html .holder { <br \/>display: inline-block; <br \/>position: relative; <br \/>margin-right: -300px; <br \/>}<br \/>\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><strong>\u5341\u3001\u9690\u85cf\u6c34\u5e73\u6eda\u52a8\u6761<\/strong><\/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><img decoding=\"async\" alt=\"div css xhtml xml Example Source Code\" src=\"\/album\/pic\/item\/fef4e389fb858ec7a5c272db.jpg\" \/> Example Source Code body { overflow-x: hidden; }<br \/>\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<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; CSS 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-99","post","type-post","status-publish","format-standard","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/posts\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/comments?post=99"}],"version-history":[{"count":0,"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/posts\/99\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/media?parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/categories?post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gaigaiming.com\/index.php\/wp-json\/wp\/v2\/tags?post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}