{"id":159,"date":"2012-10-27T08:03:24","date_gmt":"2012-10-27T08:03:24","guid":{"rendered":"http:\/\/www.nywzjs.com\/?p=159"},"modified":"2012-10-27T08:03:24","modified_gmt":"2012-10-27T08:03:24","slug":"%e8%ae%b0%e4%bd%8f%e8%bf%99%e5%87%a0%e7%82%b9%ef%bc%8cdivcss%e6%b5%8f%e8%a7%88%e5%99%a8%e5%85%bc%e5%ae%b9%e6%80%a7%e9%97%ae%e9%a2%98%e5%85%a8%e6%90%9e%e5%ae%9a%ef%bc%81","status":"publish","type":"post","link":"http:\/\/www.nywzjs.com\/?p=159","title":{"rendered":"\u8bb0\u4f4f\u8fd9\u51e0\u70b9\uff0cDIV+CSS\u6d4f\u89c8\u5668\u517c\u5bb9\u6027\u95ee\u9898\u5168\u641e\u5b9a\uff01"},"content":{"rendered":"<p>CSS\u5bf9\u6d4f\u89c8\u5668\u7684\u517c\u5bb9\u6027\u6709\u65f6\u8ba9\u4eba\u5f88\u5934\u75bc,\u6216\u8bb8\u5f53\u4f60\u4e86\u89e3\u5f53\u4e2d\u7684\u6280\u5de7\u8ddf\u539f\u7406,\u5c31\u4f1a\u89c9\u5f97\u4e5f\u4e0d\u662f\u96be\u4e8b,\u4ece\u7f51\u4e0a\u6536\u96c6\u4e86IE7,6\u4e0eFireofx\u7684\u517c\u5bb9\u6027\u5904\u7406\u65b9\u6cd5\u5e76\u6574\u7406\u4e86\u4e00\u4e0b\uff1a<\/p>\n<p><em>\u8bf7\u5c3d\u91cf\u7528xhtml\u683c\u5f0f\u5199\u4ee3\u7801\uff0c\u800c\u4e14DOCTYPE\u5f71\u54cd CSS \u5904\u7406\uff0c\u4f5c\u4e3aW3C\u6807\u51c6\uff0c\u4e00\u5b9a\u8981\u52a0DOCTYPE\u58f0\u660e\u3002<\/em><\/p>\n<p><strong>1.div\u7684\u5782\u76f4\u5c45\u4e2d\u95ee\u9898<\/strong><\/p>\n<p>vertical-align:middle; \u5c06\u884c\u8ddd\u589e\u52a0\u5230\u548c\u6574\u4e2aDIV\u4e00\u6837\u9ad8 line-height:200px; \u7136\u540e\u63d2\u5165\u6587\u5b57\uff0c\u5c31\u5782\u76f4\u5c45\u4e2d\u4e86\u3002\u7f3a\u70b9\u662f\u8981\u63a7\u5236\u5185\u5bb9\u4e0d\u8981\u6362\u884c http:\/\/www.php100.com<\/p>\n<p><strong>2. margin\u52a0\u500d\u7684\u95ee\u9898<\/strong><\/p>\n<p>\u8bbe\u7f6e\u4e3afloat\u7684div\u5728ie\u4e0b\u8bbe\u7f6e\u7684margin\u4f1a\u52a0\u500d\u3002\u8fd9\u662f\u4e00\u4e2aie6\u90fd\u5b58\u5728\u7684bug\u3002\u89e3\u51b3\u65b9\u6848\u662f\u5728\u8fd9\u4e2adiv\u91cc\u9762\u52a0\u4e0adisplay:inline;<\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<p>&lt;#div id=\u201dimfloat\u201d&gt;<br \/>\n\u76f8\u5e94\u7684css\u4e3a<br \/>\n#imfloat{<br \/>\nfloat:left;<br \/>\nmargin:5px;<br \/>\ndisplay:inline;}<\/p>\n<p><strong>\u30003.\u6d6e\u52a8ie\u4ea7\u751f\u7684\u53cc\u500d\u8ddd\u79bb<\/strong><\/p>\n<p>#box{ float:left; width:100px; margin:0 0 0 100px; \/\/\u8fd9\u79cd\u60c5\u51b5\u4e4b\u4e0bIE\u4f1a\u4ea7\u751f200px\u7684\u8ddd\u79bb display:inline; \/\/\u4f7f\u6d6e\u52a8\u5ffd\u7565}<\/p>\n<p>\u8fd9\u91cc\u7ec6\u8bf4\u4e00\u4e0bblock\u4e0einline\u4e24\u4e2a\u5143\u7d20\uff1ablock\u5143\u7d20\u7684\u7279\u70b9\u662f,\u603b\u662f\u5728\u65b0\u884c\u4e0a\u5f00\u59cb,\u9ad8\u5ea6,\u5bbd\u5ea6,\u884c\u9ad8,\u8fb9\u8ddd\u90fd\u53ef\u4ee5\u63a7\u5236(\u5757\u5143\u7d20);Inline\u5143\u7d20\u7684\u7279\u70b9\u662f,\u548c\u5176\u4ed6\u5143\u7d20\u5728\u540c\u4e00\u884c\u4e0a,\u4e0d\u53ef\u63a7\u5236(\u5185\u5d4c\u5143\u7d20);<\/p>\n<p>#box{ display:block; \/\/\u53ef\u4ee5\u4e3a\u5185\u5d4c\u5143\u7d20\u6a21\u62df\u4e3a\u5757\u5143\u7d20 display:inline; \/\/\u5b9e\u73b0\u540c\u4e00\u884c\u6392\u5217\u7684\u6548\u679c diplay:table;<\/p>\n<p><strong>4 IE\u4e0eCSS\u5bbd\u5ea6\u548cCSS\u9ad8\u5ea6\u7684\u95ee\u9898div css\u6280\u5de7<\/strong><\/p>\n<p>IE\u4e0d\u8ba4\u5f97min-\u8fd9\u4e2a\u5b9a\u4e49\uff0c\u4f46\u5b9e\u9645\u4e0a\u5b83\u628a\u6b63\u5e38\u7684width\u548cheight\u5f53\u4f5c\u6709min\u7684\u60c5\u51b5\u6765\u4f7f\u3002\u8fd9\u6837\u95ee\u9898\u5c31\u5927\u4e86\uff0c\u5982\u679c\u53ea\u7528\u5bbd\u5ea6\u548c\u9ad8\u5ea6\uff0c\u6b63\u5e38\u7684\u6d4f\u89c8\u5668\u91cc\u8fd9\u4e24\u4e2a\u503c\u5c31\u4e0d\u4f1a\u53d8\uff0c\u5982\u679c\u53ea\u7528min-width\u548cmin-height\u7684\u8bdd\uff0cIE\u4e0b\u9762\u6839\u672c\u7b49\u4e8e\u6ca1\u6709\u8bbe\u7f6e\u5bbd\u5ea6\u548c\u9ad8\u5ea6\u3002<\/p>\n<p>\u6bd4\u5982\u8981\u8bbe\u7f6e\u80cc\u666f\u56fe\u7247\uff0c\u8fd9\u4e2a\u5bbd\u5ea6\u662f\u6bd4\u8f83\u91cd\u8981\u7684\u3002\u8981\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u53ef\u4ee5\u8fd9\u6837\uff1a<\/p>\n<p>#box{ width: 80px; height: 35px;}html&gt;body #box{ width: auto; height: auto; min-width: 80px; min-height: 35px;}<\/p>\n<p><strong>\u3000\u30005.\u9875\u9762\u7684\u6700\u5c0f\u5bbd\u5ea6<\/strong><\/p>\n<p>min-width\u662f\u4e2a\u975e\u5e38\u65b9\u4fbf\u7684CSS\u547d\u4ee4\uff0c\u5b83\u53ef\u4ee5\u6307\u5b9a\u5143\u7d20\u6700\u5c0f\u4e5f\u4e0d\u80fd\u5c0f\u4e8e\u67d0\u4e2a\u5bbd\u5ea6\uff0c\u8fd9\u6837\u5c31\u80fd\u4fdd\u8bc1\u6392\u7248\u4e00\u76f4\u6b63\u786e\u3002\u4f46IE\u4e0d\u8ba4\u5f97\u8fd9\u4e2a\uff0c\u800c\u5b83\u5b9e\u9645\u4e0a\u628a width\u5f53\u505a\u6700\u5c0f\u5bbd\u5ea6\u6765\u4f7f\u3002\u4e3a\u4e86\u8ba9\u8fd9\u4e00\u547d\u4ee4\u5728IE\u4e0a\u4e5f\u80fd\u7528\uff0c\u53ef\u4ee5\u628a\u4e00\u4e2a\uff1cdiv&gt; \u653e\u5230\uff1cbody&gt; \u6807\u7b7e\u4e0b\uff0c\u7136\u540e\u4e3adiv\u6307\u5b9a\u4e00\u4e2a\u7c7b,\u7136\u540eCSS\u8fd9\u6837\u8bbe\u8ba1\uff1ahttp:\/\/www.php100.com<\/p>\n<p>#container{ min-width: 600px; width:expression_r(document.body.clientWidth \uff1c 600? \"600px\": \"auto\" );}<\/p>\n<p>\u7b2c\u4e00\u4e2amin-width\u662f\u6b63\u5e38\u7684\uff1bcss\u5236\u4f5c\u4f46\u7b2c2\u884c\u7684width\u4f7f\u7528\u4e86Javascript\uff0c\u8fd9\u53ea\u6709IE\u624d\u8ba4\u5f97\uff0c\u8fd9\u4e5f\u4f1a\u8ba9\u4f60\u7684HTML\u6587\u6863\u4e0d\u592a\u6b63\u89c4\u3002\u5b83\u5b9e\u9645\u4e0a\u901a\u8fc7Javascript\u7684\u5224\u65ad\u6765\u5b9e\u73b0\u6700\u5c0f\u5bbd\u5ea6\u3002<\/p>\n<p><strong>\u30006.DIV\u6d6e\u52a8IE\u6587\u672c\u4ea7\u751f3\u8c61\u7d20\u7684bug<\/strong><\/p>\n<p>\u5de6\u8fb9\u5bf9\u8c61\u6d6e\u52a8\uff0c\u53f3\u8fb9\u91c7\u7528\u5916\u8865\u4e01\u7684\u5de6\u8fb9\u8ddd\u6765\u5b9a\u4f4d\uff0c\u53f3\u8fb9\u5bf9\u8c61\u5185\u7684\u6587\u672c\u4f1a\u79bb\u5de6\u8fb9\u67093px\u7684\u95f4\u8ddd.<\/p>\n<p>#box{ float:left; width:800px;}<br \/>\n#left{ float:left; width:50%;}<br \/>\n#right{ width:50%;}<br \/>\n*html #left{ margin-right:-3px; \/\/\u8fd9\u53e5\u662f\u5173\u952e}<br \/>\n&lt;div id=\"box\"&gt;<br \/>\n&lt;div id=\"left\"&gt;\uff1c\/div&gt;<br \/>\n&lt;div id=\"right\"&gt;\uff1c\/div&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p><strong>7.IE\u6349\u8ff7\u85cf\u7684\u95ee\u9898<\/strong><\/p>\n<p>\u5f53div\u5e94\u7528\u590d\u6742\u7684\u65f6\u5019\u6bcf\u4e2a\u680f\u4e2d\u53c8\u6709\u4e00\u4e9b\u94fe\u63a5\uff0cDIV\u7b49\u8fd9\u4e2a\u65f6\u5019\u5bb9\u6613\u53d1\u751f\u6349\u8ff7\u85cf\u7684\u95ee\u9898\u3002<\/p>\n<p>\u6709\u4e9b\u5185\u5bb9\u663e\u793a\u4e0d\u51fa\u6765\uff0c\u5f53\u9f20\u6807\u9009\u62e9\u8fd9\u4e2a\u533a\u57df\u662f\u53d1\u73b0\u5185\u5bb9\u786e\u5b9e\u5728\u9875\u9762\u3002\u89e3\u51b3\u529e\u6cd5\uff1a\u5bf9#layout\u4f7f\u7528line-height\u5c5e\u6027\u6216\u8005\u7ed9#layout\u4f7f\u7528\u56fa\u5b9a\u9ad8\u548c\u5bbd\u3002\u9875\u9762\u7ed3\u6784\u5c3d\u91cf\u7b80\u5355\u3002http:\/\/www.php100.com<br \/>\n<strong>8.float\u7684div\u95ed\u5408;\u6e05\u9664\u6d6e\u52a8;\u81ea\u9002\u5e94\u9ad8\u5ea6<\/strong><\/p>\n<p>\u2460\u4f8b\u5982\uff1a\uff1c#div id=\u201dfloatA\u201d &gt;\uff1c#div id=\u201dfloatB\u201d &gt;\uff1c#div id=\u201dNOTfloatC\u201d &gt;\u8fd9\u91cc\u7684NOTfloatC\u5e76\u4e0d\u5e0c\u671b\u7ee7\u7eed\u5e73\u79fb\uff0c\u800c\u662f\u5e0c\u671b\u5f80\u4e0b\u6392\u3002(\u5176\u4e2dfloatA\u3001floatB\u7684\u5c5e\u6027\u5df2\u7ecf\u8bbe\u7f6e\u4e3afloat:left;)<\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u5728IE\u4e2d\u6beb\u65e0\u95ee\u9898\uff0c\u95ee\u9898\u51fa\u5728FF\u3002\u539f\u56e0\u662fNOTfloatC\u5e76\u975efloat\u6807\u7b7e\uff0c\u5fc5\u987b\u5c06float\u6807\u7b7e\u95ed\u5408\u3002\u5728 \uff1c#div class=\u201dfloatB\u201d&gt; \uff1c#div class=\u201dNOTfloatC\u201d&gt;\u4e4b\u95f4\u52a0\u4e0a \uff1c#div class=\u201dclear\u201d&gt;\u8fd9\u4e2adiv\u4e00\u5b9a\u8981\u6ce8\u610f\u4f4d\u7f6e\uff0c\u800c\u4e14\u5fc5\u987b\u4e0e\u4e24\u4e2a\u5177\u6709float\u5c5e\u6027\u7684div\u540c\u7ea7\uff0c\u4e4b\u95f4\u4e0d\u80fd\u5b58\u5728\u5d4c\u5957\u5173\u7cfb\uff0c\u5426\u5219\u4f1a\u4ea7\u751f\u5f02\u5e38\u3002\u5e76\u4e14\u5c06clear\u8fd9\u79cd\u6837\u5f0f\u5b9a\u4e49\u4e3a\u4e3a\u5982\u4e0b\u5373\u53ef\uff1a .clear{ clear:both;}<\/p>\n<p>\u2461\u4f5c\u4e3a\u5916\u90e8 wrapper \u7684 div \u4e0d\u8981\u5b9a\u6b7b\u9ad8\u5ea6,div css\u5236\u4f5c\u4e3a\u4e86\u8ba9\u9ad8\u5ea6\u80fd\u81ea\u52a8\u9002\u5e94\uff0c\u8981\u5728wrapper\u91cc\u9762\u52a0\u4e0aoverflow:hidden; \u5f53\u5305\u542bfloat\u7684box\u7684\u65f6\u5019\uff0c\u9ad8\u5ea6\u81ea\u52a8\u9002\u5e94\u5728IE\u4e0b\u65e0\u6548\uff0c\u8fd9\u65f6\u5019\u5e94\u8be5\u89e6\u53d1IE\u7684layout\u79c1\u6709\u5c5e\u6027(\u4e07\u6076\u7684IE\u554a\uff01)\u7528zoom:1;\u53ef\u4ee5\u505a\u5230\uff0c\u8fd9\u6837\u5c31\u8fbe\u5230\u4e86\u517c\u5bb9\u3002<br \/>\n\u4f8b\u5982\u67d0\u4e00\u4e2awrapper\u5982\u4e0b\u5b9a\u4e49\uff1a<\/p>\n<p>.colwrapper{ overflow:hidden; zoom:1; margin:5px auto;}<\/p>\n<p>\u2462\u5bf9\u4e8e\u6392\u7248,\u6211\u4eec\u7528\u5f97\u6700\u591a\u7684css\u63cf\u8ff0\u53ef\u80fd\u5c31\u662ffloat:left.\u6709\u7684\u65f6\u5019\u6211\u4eec\u9700\u8981\u5728n\u680f\u7684float div\u540e\u9762\u505a\u4e00\u4e2a\u7edf\u4e00\u7684\u80cc\u666f,\u8b6c\u5982:<\/p>\n<p>&lt;div id=\u201dpage\u201d&gt;<br \/>\n&lt;div id=\u201dleft\u201d&gt;\uff1c\/div&gt;<br \/>\n&lt;div id=\u201dcenter\u201d&gt;\uff1c\/div&gt;<br \/>\n&lt;div id=\u201dright\u201d&gt;\uff1c\/div&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>\u6bd4\u5982\u6211\u4eec\u8981\u5c06page\u7684\u80cc\u666f\u8bbe\u7f6e\u6210\u84dd\u8272,\u4ee5\u8fbe\u5230\u6240\u6709\u4e09\u680f\u7684\u80cc\u666f\u989c\u8272\u662f\u84dd\u8272\u7684\u76ee\u7684,\u4f46\u662f\u6211\u4eec\u4f1a\u53d1\u73b0\u968f\u7740left center right\u7684\u5411\u4e0b\u62c9\u957f,\u800cpage\u5c45\u7136\u4fdd\u5b58\u9ad8\u5ea6\u4e0d\u53d8,\u95ee\u9898\u6765\u4e86css \u5236\u4f5c,\u539f\u56e0\u5728\u4e8epage\u4e0d\u662ffloat\u5c5e\u6027,\u800c\u6211\u4eec\u7684page\u7531\u4e8e\u8981\u5c45\u4e2d,\u4e0d\u80fd\u8bbe\u7f6e\u6210 float,\u6240\u4ee5\u6211\u4eec\u5e94\u8be5\u8fd9\u6837\u89e3\u51b3<\/p>\n<p>&lt;div id=\u201dpage\u201d&gt;<br \/>\n&lt;div id=\u201dbg\u201d style=\u201dfloat:left;width:100%\u201d&gt;<br \/>\n&lt;div id=\u201dleft\u201d&gt;\uff1c\/div&gt;<br \/>\n&lt;div id=\u201dcenter\u201d&gt;\uff1c\/div&gt;<br \/>\n&lt;div id=\u201dright\u201d&gt;\uff1c\/div&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>\u518d\u5d4c\u5165\u4e00\u4e2afloat left\u800c\u5bbd\u5ea6\u662f100%\u7684DIV\u89e3\u51b3\u4e4b\u9053\u3002<br \/>\n\u2463\u4e07\u80fdfloat \u95ed\u5408(\u975e\u5e38\u91cd\u8981!)<\/p>\n<p>\u5173\u4e8e clear CSS float \u7684\u539f\u7406\u53ef\u53c2\u89c1 [How To Clear Floats Without Structural Markup],\u5c06\u4ee5\u4e0b\u4ee3\u7801\u52a0\u5165Global CSS \u4e2d,\u7ed9\u9700\u8981\u95ed\u5408\u7684div\u52a0\u4e0a \u5373\u53ef,\u5c61\u8bd5\u4e0d\u723d.<br \/>\n.clearfix:after { content:\".\"; display:block; height:0; clear:both; visibility:hidden; }<br \/>\n.clearfix { display:inline-block; }<\/p>\n<p>.clearfix {display:block;}<\/p>\n<p>\u6216\u8005\u8fd9\u6837\u8bbe\u7f6e\uff1a.hackbox{ display:table; \/\/\u5c06\u5bf9\u8c61\u4f5c\u4e3a\u5757\u5143\u7d20\u7ea7\u7684\u8868\u683c\u663e\u793a}<\/p>\n<p><strong>9\uff0e\u9ad8\u5ea6\u4e0d\u80fd\u81ea\u9002\u5e94<\/strong><\/p>\n<p>\u9ad8\u5ea6\u4e0d\u80fd\u81ea\u9002\u5e94\u662f\u5f53\u5185\u5c42\u5bf9\u8c61\u7684\u9ad8\u5ea6\u53d1\u751f\u53d8\u5316\u65f6\u5916\u5c42\u9ad8\u5ea6\u4e0d\u80fd\u81ea\u52a8\u8fdb\u884c\u8c03\u8282\uff0c\u7279\u522b\u662f\u5f53\u5185\u5c42\u5bf9\u8c61\u4f7f\u7528margin \u6216paddign \u65f6\u3002<\/p>\n<p>\u4f8b\uff1a<\/p>\n<p>#box {background-color:#eee; }<br \/>\n#box p {margin-top: 20px;margin-bottom: 20px; text-align:center; }<br \/>\n&lt;div id=\"box\"&gt;<br \/>\n&lt;p&gt;p\u5bf9\u8c61\u4e2d\u7684\u5185\u5bb9\uff1c\/p&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>\u89e3\u51b3\u6280\u5de7\uff1a\u5728P\u5bf9\u8c61\u4e0a\u4e0b\u5404\u52a02\u4e2a\u7a7a\u7684div\u5bf9\u8c61CSS\u4ee3\u7801\uff1a.1{height:0px;overflow:hidden;}\u6216\u8005\u4e3aDIV\u52a0\u4e0aborder\u5c5e\u6027\u3002<\/p>\n<p><strong>\u300010 .div+css\u4e4bIE6\u4e0b\u4e3a\u4ec0\u4e48\u56fe\u7247\u4e0b\u6709\u7a7a\u9699\u4ea7\u751f<\/strong><\/p>\n<p>\u89e3\u51b3\u8fd9\u4e2aBUG\u7684\u6280\u5de7\u4e5f\u6709\u5f88\u591a,\u53ef\u4ee5\u662f\u6539\u53d8html\u7684\u6392\u7248,\u6216\u8005\u8bbe\u7f6eimg \u4e3adisplay:block \u6216\u8005\u8bbe\u7f6evertical-align \u5c5e\u6027\u4e3avertical-align:top<\/p>\n<p>bottom \u3000middle \u3000text-bottom \u90fd\u53ef\u4ee5\u89e3\u51b3.<\/p>\n<p>11.\u5982\u4f55\u5bf9\u9f50\u6587\u672c\u4e0e\u6587\u672c\u8f93\u5165\u6846<\/p>\n<p>\u52a0\u4e0a vertical-align:middle;<\/p>\n<p>&lt;style type=\"text\/css\"&gt;<br \/>\n&lt;!--<br \/>\ninput {<br \/>\nwidth:200px;<br \/>\nheight:30px;<br \/>\nborder:1px solid red;<br \/>\nvertical-align:middle;<br \/>\n}<br \/>\n--&gt;<br \/>\n&lt;\/style&gt;<\/p>\n<p><strong>\u300012.web\u6807\u51c6\u4e2d\u5b9a\u4e49id\u4e0eclass\u533a\u522b\u5417<\/strong><\/p>\n<p>(1).web\u6807\u51c6\u4e2d\u662f\u4e0d\u5bb9\u8bb8\u91cd\u590dID\u7684,\u6bd4\u5982 div id=\"aa\" \u4e0d\u5bb9\u8bb8\u91cd\u590d2\u6b21,\u800cCSS class\u5b9a\u4e49\u7684\u662f\u7c7b,\u7406\u8bba\u4e0a\u53ef\u4ee5\u65e0\u9650\u91cd\u590d, \u8fd9\u6837\u9700\u8981\u591a\u6b21\u5f15\u7528\u7684\u5b9a\u4e49\u4fbf\u53ef\u4ee5\u4f7f\u7528\u4ed6.<\/p>\n<p>(2).\u5c5e\u6027\u7684\u4f18\u5148\u7ea7\u95ee\u9898<\/p>\n<p>CSS ID\u7684\u4f18\u5148\u7ea7\u8981\u9ad8\u4e8eclass,\u770b\u4e0a\u9762\u7684\u4f8b\u5b50<\/p>\n<p>(3).\u65b9\u4fbfJS\u7b49\u5ba2\u6237\u7aef\u811a\u672c,\u5982\u679c\u5728\u9875\u9762\u4e2d\u8981\u5bf9\u67d0\u4e2a\u5bf9\u8c61\u8fdb\u884c\u811a\u672c\u64cd\u4f5c,\u90a3\u4e48\u53ef\u4ee5\u7ed9\u4ed6\u5b9a\u4e49\u4e00\u4e2aID,\u5426\u5219\u53ea\u80fd\u5229\u7528\u904d\u5386\u9875\u9762\u5143\u7d20\u52a0\u4e0a\u6307\u5b9a\u7279\u5b9a\u5c5e\u6027\u6765\u627e\u5230\u5b83,\u8fd9\u662f\u76f8\u5bf9\u6d6a\u8d39\u65f6\u95f4\u8d44\u6e90,\u8fdc\u8fdc\u4e0d\u5982\u4e00\u4e2aID\u6765\u5f97\u7b80\u5355\u3002<\/p>\n<p><strong>13. LI\u4e2d\u5185\u5bb9\u8d85\u8fc7\u957f\u5ea6\u540e\u4ee5\u7701\u7565\u53f7\u663e\u793a\u7684\u6280\u5de7<\/strong><\/p>\n<p>\u6b64\u6280\u5de7\u9002\u7528\u4e0eIE\u4e0eOP\u6d4f\u89c8\u5668<\/p>\n<p>&lt;style type=\"text\/css\"&gt;<br \/>\n&lt;!--<br \/>\nli {<br \/>\nwidth:200px;<br \/>\nwhite-space:nowrap;<br \/>\ntext-overflow:ellipsis;<br \/>\n-o-text-overflow:ellipsis;<br \/>\noverflow: hidden;<br \/>\n}<\/p>\n<p>--&gt;<br \/>\n&lt;\/style&gt;<\/p>\n<p><strong>\u3000\u300014.\u4e3a\u4ec0\u4e48web\u6807\u51c6\u4e2dIE\u65e0\u6cd5\u8bbe\u7f6e\u6eda\u52a8\u6761\u989c\u8272\u4e86<\/strong><\/p>\n<p>\u89e3\u51b3\u529e\u6cd5\u662f\u5c06body\u6362\u6210html<\/p>\n<p>&lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Strict\/\/EN\"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-strict.dtd&gt;<br \/>\n&lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=gb2312\" \/&gt;<\/p>\n<p>&lt;style type=\"text\/css\"&gt;<br \/>\n&lt;!--<\/p>\n<p>html {<br \/>\nscrollbar-face-color:#f6f6f6;<br \/>\nscrollbar-highlight-color:#fff;<br \/>\nscrollbar-shadow-color:#eeeeee;<br \/>\nscrollbar-3dlight-color:#eeeeee;<br \/>\nscrollbar-arrow-color:#000;<br \/>\nscrollbar-track-color:#fff;<br \/>\nscrollbar-darkshadow-color:#fff;<br \/>\n}<br \/>\n--&gt;<br \/>\n\uff1c\/style&gt;<\/p>\n<p><strong>15.\u4e3a\u4ec0\u4e48\u65e0\u6cd5\u5b9a\u4e491px\u5de6\u53f3\u9ad8\u5ea6\u7684\u5bb9\u5668<\/strong><\/p>\n<p>IE6\u4e0b\u8fd9\u4e2a\u95ee\u9898\u662f\u56e0\u4e3a\u9ed8\u8ba4\u7684\u884c\u9ad8\u9020\u6210\u7684,\u89e3\u51b3\u7684\u6280\u5de7\u4e5f\u6709\u5f88\u591a,\u4f8b\u5982:<br \/>\noverflow:hidden \u3000 zoom:0.08 \u3000 line-height:1px<\/p>\n<p><strong>16.\u600e\u4e48\u6837\u624d\u80fd\u8ba9\u5c42\u663e\u793a\u5728FLASH\u4e4b\u4e0a\u5462<\/strong><\/p>\n<p>\u89e3\u51b3\u7684\u529e\u6cd5\u662f\u7ed9FLASH\u8bbe\u7f6e\u900f\u660e<\/p>\n<p>&lt;param name=\"wmode\" value=\"transparent\" \/&gt;<\/p>\n<p><strong>\u3000\u300017.\u600e\u6837\u4f7f\u4e00\u4e2a\u5c42\u5782\u76f4\u5c45\u4e2d\u4e8e\u6d4f\u89c8\u5668\u4e2d<\/strong><\/p>\n<p>\u8fd9\u91cc\u6211\u4eec\u4f7f\u7528\u767e\u5206\u6bd4\u7edd\u5bf9\u5b9a\u4f4d,\u4e0e\u5916\u8865\u4e01\u8d1f\u503c\u7684\u6280\u5de7,\u8d1f\u503c\u7684\u5927\u5c0f\u4e3a\u5176\u81ea\u8eab\u5bbd\u5ea6\u9ad8\u5ea6\u9664\u4ee5\u4e8c<\/p>\n<p>&lt;style type=\"text\/css\"&gt;<br \/>\n&lt;!--<br \/>\ndiv {<br \/>\nposition:absolute;<br \/>\ntop:50%;<br \/>\nlef:50%;<br \/>\nmargin:-100px 0 0 -100px;<br \/>\nwidth:200px;<br \/>\nheight:200px;<br \/>\nborder:1px solid red;<br \/>\n}<br \/>\n--&gt;<br \/>\n&lt;\/style&gt;<br \/>\n<strong>Firefox\u4e0eIE\u7684CSS\u517c\u5bb9CSS HACK\u6280\u5de7<\/strong><\/p>\n<p><strong>\u30001. Div\u5c45\u4e2d\u95ee\u9898<\/strong><\/p>\n<p>div\u8bbe\u7f6e margin-left, margin-right \u4e3a auto \u65f6\u5df2\u7ecf\u5c45\u4e2d\uff0cIE \u4e0d\u884c\uff0cIE\u9700\u8981\u8bbe\u5b9abody\u5c45\u4e2d\uff0c\u9996\u5148\u5728\u7236\u7ea7\u5143\u7d20\u5b9a\u4e49text-algin: center;\u8fd9\u4e2a\u7684\u610f\u601d\u5c31\u662f\u5728\u7236\u7ea7\u5143\u7d20\u5185\u7684\u5185\u5bb9\u5c45\u4e2d\u3002<\/p>\n<p><strong>2.CSS \u94fe\u63a5(a\u6807\u7b7e)\u7684\u8fb9\u6846\u4e0e\u80cc\u666f<\/strong><\/p>\n<p>a\u94fe\u63a5\u52a0\u8fb9\u6846\u548c\u80cc\u666f\u8272\uff0c\u9700\u8bbe\u7f6e display: block, \u540c\u65f6\u8bbe\u7f6e float: left \u4fdd\u8bc1\u4e0d\u6362\u884c\u3002\u53c2\u7167 menubar, \u7ed9 a \u548c menubar \u8bbe\u7f6e\u9ad8\u5ea6\u662f\u4e3a\u4e86\u907f\u514d\u5e95\u8fb9\u663e\u793a\u9519\u4f4d, \u82e5\u4e0d\u8bbe height, \u53ef\u4ee5\u5728 menubar \u4e2d\u63d2\u5165\u4e00\u4e2a\u7a7a\u683c\u3002<\/p>\n<p><strong>\u3000\u30003.\u8d85\u94fe\u63a5\u8bbf\u95ee\u8fc7\u540ehover\u6837\u5f0f\u5c31\u4e0d\u51fa\u73b0\u7684\u95ee\u9898<\/strong><\/p>\n<p>\u88ab\u70b9\u51fb\u8bbf\u95ee\u8fc7\u7684\u8d85\u94fe\u63a5\u6837\u5f0f\u4e0d\u5728\u5177\u6709hover\u548cactive\u4e86,\u5f88\u591a\u4eba\u5e94\u8be5\u90fd\u9047\u5230\u8fc7\u8fd9\u4e2a\u95ee\u9898,\u89e3\u51b3\u6280\u5de7\u662f\u6539\u53d8CSS\u5c5e\u6027\u7684\u6392\u5217\u987a\u5e8f: L-V-H-A<\/p>\n<p>Code:<\/p>\n<p>&lt;style type=\"text\/css\"&gt;<br \/>\n&lt;!--<br \/>\na:link {}<br \/>\na:visited {}<br \/>\na:hover {}<br \/>\na:active {}<br \/>\n--&gt;<br \/>\n&lt;\/style&gt;<\/p>\n<p><strong>\u30004. \u6e38\u6807\u624b\u6307cursor<\/strong><\/p>\n<p>cursor: pointer \u53ef\u4ee5\u540c\u65f6\u5728 IE FF \u4e2d\u663e\u793a\u6e38\u6807\u624b\u6307\u72b6\uff0c hand \u4ec5 IE \u53ef\u4ee5<\/p>\n<p><strong>5.UL\u7684padding\u4e0emargin<\/strong><\/p>\n<p>ul\u6807\u7b7e\u5728FF\u4e2d\u9ed8\u8ba4\u662f\u6709padding\u503c\u7684,\u800c\u5728IE\u4e2d\u53ea\u6709margin\u9ed8\u8ba4\u6709\u503c,\u6240\u4ee5\u5148\u5b9a\u4e49 ul{margin:0;padding:0;}\u5c31\u80fd\u89e3\u51b3\u5927\u90e8\u5206\u95ee\u9898<\/p>\n<p><strong>\u30006. FORM\u6807\u7b7e<\/strong><\/p>\n<p>\u8fd9\u4e2a\u6807\u7b7e\u5728IE\u4e2d,\u5c06\u4f1a\u81ea\u52a8margin\u4e00\u4e9b\u8fb9\u8ddd,\u800c\u5728FF\u4e2dmargin\u5219\u662f0,\u56e0\u6b64,\u5982\u679c\u60f3\u663e\u793a\u4e00\u81f4,\u6240\u4ee5\u6700\u597d\u5728css\u4e2d\u6307\u5b9amargin\u548c padding,\u9488\u5bf9\u4e0a\u9762\u4e24\u4e2a\u95ee\u9898,\u6211\u7684css\u4e2d\u4e00\u822c\u9996\u5148\u90fd\u4f7f\u7528\u8fd9\u6837\u7684\u6837\u5f0ful,form{margin:0;padding:0;}\u7ed9\u5b9a\u4e49\u6b7b\u4e86,\u6240\u4ee5\u540e\u9762\u5c31\u4e0d\u4f1a\u4e3a\u8fd9\u4e2a\u5934\u75bc\u4e86.<\/p>\n<p><strong>\u30007. BOX\u6a21\u578b\u89e3\u91ca\u4e0d\u4e00\u81f4\u95ee\u9898<\/strong><\/p>\n<p>\u5728FF\u548cIE\u4e2d\u7684BOX\u6a21\u578b\u89e3\u91ca\u4e0d\u4e00\u81f4\u5bfc\u81f4\u76f8\u5dee2px\u89e3\u51b3\u6280\u5de7\uff1adiv{margin:30px!important;margin:28px;} \u6ce8\u610f\u8fd9\u4e24\u4e2amargin\u7684\u987a\u5e8f\u4e00\u5b9a\u4e0d\u80fd\u5199\u53cd\uff0c important\u8fd9\u4e2a\u5c5e\u6027IE\u4e0d\u80fd\u8bc6\u522b\uff0c\u4f46\u522b\u7684\u6d4f\u89c8\u5668\u53ef\u4ee5\u8bc6\u522b\u3002\u6240\u4ee5\u5728IE\u4e0b\u5176\u5b9e\u89e3\u91ca\u6210\u8fd9\u6837\uff1a<\/p>\n<p>div{maring:30px;margin:28px}\u91cd\u590d\u5b9a\u4e49\u7684\u8bdd\u6309\u7167\u6700\u540e\u4e00\u4e2a\u6765\u6267\u884c\uff0c\u6240\u4ee5\u4e0d\u53ef\u4ee5\u53ea\u5199margin:xx px!important;#box{ width:600px; \/\/for ie6.0- w\\idth:500px; \/\/for ff+ie6.0}<br \/>\n#box{ width:600px!important \/\/for ff width:600px; \/\/for ff+ie6.0 width :500px; \/\/for ie6.0-}<\/p>\n<p><strong>8.\u5c5e\u6027\u9009\u62e9\u5668(\u8fd9\u4e2a\u4e0d\u80fd\u7b97\u662f\u517c\u5bb9,\u662f\u9690\u85cfcss\u7684\u4e00\u4e2abug)<\/strong><\/p>\n<p>p[id]{}div[id]{}<\/p>\n<p>\u8fd9\u4e2a\u5bf9\u4e8eIE6.0\u548cIE6.0\u4ee5\u4e0b\u7684\u7248\u672c\u90fd\u9690\u85cf,FF\u548cOPera\u4f5c\u7528.\u5c5e\u6027\u9009\u62e9\u5668\u548c\u5b50\u9009\u62e9\u5668\u8fd8\u662f\u6709\u533a\u522b\u7684,\u5b50\u9009\u62e9\u5668\u7684\u8303\u56f4\u4ece\u5f62\u5f0f\u6765\u8bf4\u7f29\u5c0f\u4e86,\u5c5e\u6027\u9009\u62e9\u5668\u7684\u8303\u56f4\u6bd4\u8f83\u5927,\u5982p[id]\u4e2d,\u6240\u6709p\u6807\u7b7e\u4e2d\u6709id\u7684\u90fd\u662f\u540c\u6837\u5f0f\u7684.<\/p>\n<p><strong>\u30009.\u6700\u72e0\u7684\u624b\u6bb5 - !important<\/strong><\/p>\n<p>\u5982\u679c\u5b9e\u5728\u6ca1\u6709\u529e\u6cd5\u89e3\u51b3\u4e00\u4e9b\u7ec6\u8282\u95ee\u9898,\u53ef\u4ee5\u7528\u8fd9\u4e2a\u6280\u5de7.FF\u5bf9\u4e8e\u201d!important\u201d\u4f1a\u81ea\u52a8\u4f18\u5148\u89e3\u6790,\u7136\u800cIE\u5219\u4f1a\u5ffd\u7565.\u5982\u4e0b<\/p>\n<p>.tabd1{<br \/>\nbackground:url(http:\/\/www.php100.com\/res\/images\/up\/tab1.gif) no-repeat 0px 0px !important;<br \/>\nbackground:url(http:\/\/www.php100.com\u00a0\/res\/images\/up\/tab1.gif) no-repeat 1px 0px; }<\/p>\n<p>\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u4e00\u5b9a\u8981\u5c06xxxx !important \u8fd9\u53e5\u653e\u7f6e\u5728\u53e6\u4e00\u53e5\u4e4b\u4e0a\u3002<\/p>\n<p><strong>\u3000\u300010.IE,FF\u7684\u9ed8\u8ba4\u503c\u95ee\u9898<\/strong><\/p>\n<p>\u6216\u8bb8\u4f60\u4e00\u76f4\u5728\u62b1\u6028\u4e3a\u4ec0\u4e48\u8981\u4e13\u95e8\u4e3aIE\u548cFF\u5199\u4e0d\u540c\u7684CSS\uff0c\u4e3a\u4ec0\u4e48IE\u8fd9\u6837\u8ba9\u4eba\u5934\u75bc\uff0c\u7136\u540e\u4e00\u8fb9\u5199css\uff0c\u4e00\u8fb9\u5492\u9a82\u90a3\u4e2a\u53ef\u6076\u7684M$ IE.\u5176\u5b9e\u5bf9\u4e8ecss\u7684\u6807\u51c6\u652f\u6301\u65b9\u9762\uff0cIE\u5e76\u6ca1\u6709\u6211\u4eec\u60f3\u8c61\u7684\u90a3\u4e48\u53ef\u6076\uff0c\u5173\u952e\u5728\u4e8eIE\u548cFF\u7684\u9ed8\u8ba4\u503c\u4e0d\u4e00\u6837\u800c\u5df2\uff0c\u638c\u63e1\u4e86\u8fd9\u4e2a\u6280\u5de7\uff0c\u4f60\u4f1a\u53d1\u73b0\u5199\u51fa\u517c\u5bb9FF\u548c IE\u7684css\u5e76\u4e0d\u662f\u90a3\u4e48\u56f0\u96be\uff0c\u6216\u8bb8\u5bf9\u4e8e\u7b80\u5355\u7684css\uff0c\u4f60\u5b8c\u5168\u53ef\u4ee5\u4e0d\u7528\u201d!important\u201d\u8fd9\u4e2a\u4e1c\u897f\u4e86\u3002<\/p>\n<p>\u6211\u4eec\u90fd\u77e5\u9053\uff0c\u6d4f\u89c8\u5668\u5728\u663e\u793a\u7f51\u9875\u7684\u65f6\u5019\uff0c\u90fd\u4f1a\u6839\u636e\u7f51\u9875\u7684css\u6837\u5f0f\u8868\u6765\u51b3\u5b9a\u5982\u4f55\u663e\u793a\uff0c\u4f46\u662f\u6211\u4eec\u5728\u6837\u5f0f\u8868\u4e2d\u672a\u5fc5\u4f1a\u5c06\u6240\u6709\u7684\u5143\u7d20\u90fd\u8fdb\u884c\u4e86\u5177\u4f53\u7684\u63cf\u8ff0\uff0c\u5f53\u7136\u4e5f\u6ca1\u6709\u5fc5\u8981\u90a3\u4e48\u505a\uff0c\u6240\u4ee5\u5bf9\u4e8e\u90a3\u4e9b\u6ca1\u6709\u63cf\u8ff0\u7684\u5c5e\u6027\uff0c\u6d4f\u89c8\u5668\u5c06\u91c7\u7528\u5185\u7f6e\u9ed8\u8ba4\u7684\u65b9\u5f0f\u6765\u8fdb\u884c\u663e\u793a\uff0c\u8b6c\u5982\u6587\u5b57\uff0c\u5982\u679c\u4f60\u6ca1\u6709\u5728css\u4e2d\u6307\u5b9a\u989c\u8272\uff0c\u90a3\u4e48\u6d4f\u89c8\u5668\u5c06\u91c7\u7528\u9ed1\u8272\u6216\u8005\u7cfb\u7edf\u989c\u8272\u6765\u663e\u793a\uff0cdiv\u6216\u8005\u5176\u4ed6\u5143\u7d20\u7684\u80cc\u666f\uff0c\u5982\u679c\u5728css\u4e2d\u6ca1\u6709\u88ab\u6307\u5b9a\uff0c\u6d4f\u89c8\u5668\u5219\u5c06\u5176\u8bbe\u7f6e\u4e3a\u767d\u8272\u6216\u8005\u900f\u660e\uff0c\u7b49\u7b49\u5176\u4ed6\u672a\u5b9a\u4e49\u7684\u6837\u5f0f\u5747\u5982\u6b64\u3002\u6240\u4ee5\u6709\u5f88\u591a\u4e1c\u897f\u51fa\u73b0 FF\u548cIE\u663e\u793a\u4e0d\u4e00\u6837\u7684\u6839\u672c\u539f\u56e0\u5728\u4e8e\u5b83\u4eec\u7684\u9ed8\u8ba4\u663e\u793a\u4e0d\u4e00\u6837\uff0c\u800c\u8fd9\u4e2a\u9ed8\u8ba4\u6837\u5f0f\u8be5\u5982\u4f55\u663e\u793a\u6211\u77e5\u9053\u5728w3\u4e2d\u6709\u6ca1\u6709\u5bf9\u5e94\u7684\u6807\u51c6\u6765\u8fdb\u884c\u89c4\u5b9a\uff0c\u56e0\u6b64\u5bf9\u4e8e\u8fd9\u70b9\u4e5f\u5c31\u522b\u53bb\u602a\u7f6aIE\u4e86\u3002<\/p>\n<p><strong>11.\u4e3a\u4ec0\u4e48FF\u4e0b\u6587\u672c\u65e0\u6cd5\u6491\u5f00\u5bb9\u5668\u7684\u9ad8\u5ea6<\/strong><\/p>\n<p>\u6807\u51c6\u6d4f\u89c8\u5668\u4e2d\u56fa\u5b9a\u9ad8\u5ea6\u503c\u7684\u5bb9\u5668\u662f\u4e0d\u4f1a\u8c61IE6\u91cc\u90a3\u6837\u88ab\u6491\u5f00\u7684,\u90a3\u6211\u53c8\u60f3\u56fa\u5b9a\u9ad8\u5ea6,\u53c8\u60f3\u80fd\u88ab\u6491\u5f00\u9700\u8981\u600e\u6837\u8bbe\u7f6e\u5462\uff1f\u529e\u6cd5\u5c31\u662f\u53bb\u6389height\u8bbe\u7f6emin- height:200px; \u8fd9\u91cc\u4e3a\u4e86\u7167\u987e\u4e0d\u8ba4\u8bc6min-height\u7684IE6 \u53ef\u4ee5\u8fd9\u6837\u5b9a\u4e49:<\/p>\n<p>{<br \/>\nheight:auto!important;<br \/>\nheight:200px;<br \/>\nmin-height:200px;<br \/>\n}<\/p>\n<p><strong>12.FireFox\u4e0b\u5982\u4f55\u4f7f\u8fde\u7eed\u957f\u5b57\u6bb5\u81ea\u52a8\u6362\u884c<\/strong><\/p>\n<p>\u4f17\u6240\u5468\u77e5IE\u4e2d\u76f4\u63a5\u4f7f\u7528 word-wrap:break-word \u5c31\u53ef\u4ee5\u4e86, FF\u4e2d\u6211\u4eec\u4f7f\u7528JS\u63d2\u5165<br \/>\n\u7684\u6280\u5de7\u6765\u89e3\u51b3<\/p>\n<p>&lt;style type=\"text\/css\"&gt;<br \/>\n&lt;!--<br \/>\ndiv {<br \/>\nwidth:300px;<br \/>\nword-wrap:break-word;<br \/>\nborder:1px solid red;<br \/>\n}<br \/>\n--&gt;<br \/>\n&lt;\/style&gt;<\/p>\n<p>&lt;div id=\"ff\"&gt;aaaaaaaaaaaaaaaaaaaaaaaaaaaa\uff1c\/div&gt;<\/p>\n<p>&lt;scr\u012bpt type=\"text\/javascr\u012bpt\"&gt;<\/p>\n<p>function toBreakWord(el, intLen){<br \/>\nvar \u014dbj=document.getElementByIdx_x_xx_x_x(el);<br \/>\nvar strContent=obj.innerHTML;<br \/>\nvar strTemp=\"\";<br \/>\nwhile(strContent.length&gt;intLen){<br \/>\nstrTemp+=strContent.substr(0,intLen)+\"<br \/>\n\";<br \/>\nstrContent=strContent.substr(intLen,strContent.length);<br \/>\n}<br \/>\nstrTemp+=\"<br \/>\n\"+strContent;<br \/>\nobj.innerHTML=strTemp;<br \/>\n}<br \/>\nif(document.getElementByIdx_x_xx_x_x &amp;&amp; !document.all) toBreakWord(\"ff\", 37);<\/p>\n<p>&lt;\/scr\u012bpt&gt;<br \/>\n<strong>\u300013.\u4e3a\u4ec0\u4e48IE6\u4e0b\u5bb9\u5668\u7684\u5bbd\u5ea6\u548cFF\u89e3\u91ca\u4e0d\u540c\uff1f<\/strong><\/p>\n<p>\u95ee\u9898\u7684\u5dee\u522b\u5728\u4e8e\u5bb9\u5668\u7684\u6574\u4f53\u5bbd\u5ea6\u6709\u6ca1\u6709\u5c06\u8fb9\u6846\uff08border\uff09\u7684\u5bbd\u5ea6\u7b97\u5728\u5176\u5185,\u8fd9\u91ccIE6\u89e3\u91ca\u4e3a200PX ,\u800cFF\u5219\u89e3\u91ca\u4e3a220PX,\u90a3\u7a76\u7adf\u662f\u600e\u4e48\u5bfc\u81f4\u7684\u95ee\u9898\u5462\uff1f\u5927\u5bb6\u628a\u5bb9\u5668\u9876\u90e8\u7684xml\u53bb\u6389\u5c31\u4f1a\u53d1\u73b0\u539f\u6765\u95ee\u9898\u51fa\u5728\u8fd9,\u9876\u90e8\u7684\u7533\u660e\u89e6\u53d1\u4e86IE\u7684qurks mode\u3002<\/p>\n<p>&lt;?xml version=\"1.0\" encoding=\"gb2312\"?&gt;<br \/>\n&lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Strict\/\/EN\" http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-strict.dtd&gt;<br \/>\n&lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=gb2312\" \/&gt;<br \/>\n&lt;style type=\"text\/css\"&gt;<br \/>\n&lt;!--<br \/>\ndiv {<br \/>\ncursor:pointer;<br \/>\nwidth:200px;<br \/>\nheight:200px;<br \/>\nborder:10px solid red<br \/>\n}<br \/>\n--&gt;<br \/>\n&lt;\/style&gt;<br \/>\n&lt;div \u014dnclick=\"alert(this.offsetWidth)\"&gt;\u8ba9FireFox\u4e0eIE\u517c\u5bb9\uff1c\/div&gt;<\/p>\n<p>IE7.0\u5bf9CSS\u7684\u652f\u6301\u53c8\u6709\u65b0\u95ee\u9898\uff0c\u89e3\u51b3\u5982\u4e0b\u3002<\/p>\n<p>\u7b2c\u4e00\u79cd\uff0cCSS HACK<\/p>\n<p>Bpx;<br \/>\n_height:20px;<\/p>\n<p>\u6ce8\u610f\u987a\u5e8f\u3002<\/p>\n<p>\u4e0b\u9762\u8fd9\u6837\u4e5f\u5c5e\u4e8ediv CSS HACK\uff0c\u4e0d\u8fc7\u6ca1\u6709\u4e0a\u9762\u8fd9\u6837\u7b80\u6d01\u3002<\/p>\n<p>#example { color: #333; }<br \/>\n* html #example { color: #666; }<br \/>\n*+html #example { color: #999; }<\/p>\n<p>\u7b2c\u4e8c\u79cd\uff0c\u662f\u4f7f\u7528IE\u4e13\u7528\u7684\u6761\u4ef6CSS\u6ce8\u91ca<\/p>\n<p>&lt;!--\u5176\u4ed6\u6d4f\u89c8\u5668 --&gt;<br \/>\n&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"css.css\" \/&gt;<\/p>\n<p>&lt;!--[if IE 7]&gt;<br \/>\n&lt;!-- \u9002\u5408\u4e8eIE7 --&gt;<br \/>\n&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"ie7.css\" \/&gt;<br \/>\n&lt;![endif]--&gt;<\/p>\n<p>&lt;!--[if lte IE 6]&gt;<br \/>\n&lt;!-- \u9002\u5408\u4e8eIE6\u53ca\u4e00\u4e0b --&gt;<br \/>\n&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"ie.css\" \/&gt;<br \/>\n&lt;![endif]--&gt;<\/p>\n<p>\u7b2c\u4e09\u79cd\uff0ccss filter\u7684\u529e\u6cd5\uff0c\u4ee5\u4e0b\u662f\u4ece\u56fd\u5916\u7f51\u7ad9\u7ffb\u8bd1\u8fc7\u6765\u7684\u3002<\/p>\n<p>\u65b0\u5efa\u4e00\u4e2acss\u6837\u5f0f\u5982\u4e0b\uff1a<\/p>\n<p>#item {<br \/>\nwidth: 200px;<br \/>\nheight: 200px;<br \/>\nbackground: red;<br \/>\n}<\/p>\n<p>\u65b0\u5efa\u4e00\u4e2adiv,\u5e76\u4f7f\u7528\u524d\u9762\u5b9a\u4e49\u7684css\u7684\u6837\u5f0f\uff1a<\/p>\n<p>&lt;div id=\"item\"&gt;some text here\uff1c\/div&gt;<\/p>\n<p>\u5728body\u8868\u73b0\u8fd9\u91cc\u52a0\u5165lang\u5c5e\u6027,\u4e2d\u6587\u4e3azh\uff1a<\/p>\n<p>&lt;body lang=\"en\"&gt;<\/p>\n<p>\u73b0\u5728\u5bf9div\u5143\u7d20\u518d\u5b9a\u4e49\u4e00\u4e2a\u6837\u5f0f\uff1a<\/p>\n<p>*:lang(en) #item{<br \/>\nbackground:green !important;<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CSS\u5bf9\u6d4f\u89c8\u5668\u7684\u517c\u5bb9\u6027\u6709\u65f6\u8ba9\u4eba\u5f88\u5934\u75bc,\u6216\u8bb8\u5f53\u4f60\u4e86\u89e3\u5f53\u4e2d\u7684\u6280\u5de7\u8ddf\u539f\u7406,\u5c31\u4f1a\u89c9\u5f97\u4e5f\u4e0d\u662f\u96be\u4e8b,\u4ece\u7f51\u4e0a\u6536\u96c6\u4e86IE7,6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,13],"tags":[30,19,60],"_links":{"self":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/posts\/159"}],"collection":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=159"}],"version-history":[{"count":0,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=\/wp\/v2\/posts\/159\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=159"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.nywzjs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}