{"id":42,"date":"2009-12-21T23:39:21","date_gmt":"2009-12-21T15:39:21","guid":{"rendered":"http:\/\/www.bluesdream.com\/blog\/div-css-page-layout-commonly-used-in-writing-specifications.html"},"modified":"2010-02-24T19:48:09","modified_gmt":"2010-02-24T11:48:09","slug":"div-css-layout-writing-specifications","status":"publish","type":"post","link":"https:\/\/www.bluesdream.com\/blog\/div-css-layout-writing-specifications.html","title":{"rendered":"DIV+CSS\u7f51\u9875\u5e03\u5c40\u5e38\u7528\u7684\u4e66\u5199\u89c4\u8303"},"content":{"rendered":"<p>\u6d4f\u89c8\u7f51\u9875\u4f1a\u51fa\u73b0\u7ed3\u6784\u4e0d\u51c6\u786e\u7684\u72b6\u51b5\uff0c\u5e38\u5e38\u56e0\u4e3a\u4e66\u5199\u7f51\u9875\u4e0d\u89c4\u8303\u9020\u6210\u3002\u4fd7\u8bdd\u8bf4\uff0c\u6ca1\u6709\u89c4\u77e9\u4e0d\u6210\u65b9\u5706\uff0c\u6240\u6709\u7684\u4e8b\u60c5\u9075\u5faa\u7740\u4e00\u4e2a\u826f\u597d\u7684\u89c4\u5f8b\uff0c\u4f1a\u4e8b\u534a\u529f\u500d\u8bb8\u591a\u3002\u4e00\u4e2a\u826f\u597d\u7684\u4e66\u5199\u89c4\u8303\uff0c\u4e0d\u4ec5\u4ec5\u80fd\u51cf\u5c11\u9519\u8bef\uff0c\u4e5f\u65b9\u4fbf\u4e86\u5927\u5bb6\u548c\u81ea\u5df1\u7684\u67e5\u770b\uff0c\u8ba9\u4ee3\u7801\u66f4\u4e3a\u660e\u4e86\u3002<br \/>\n\u4e0b\u9762\u5c31\u4ecb\u7ecd\u4e00\u4e9bDIV+CSS\u7f51\u9875\u5e03\u5c40\u5e38\u7528\u7684\u4e66\u5199\u89c4\u8303\uff1a<\/p>\n<p><!--more--><strong>\u4e00. \u5e38\u89c4\u4e66\u5199\u89c4\u8303\u53ca\u65b9\u6cd5<\/strong><\/p>\n<p>1. \u9009\u62e9DOCTYPE\uff1a<\/p>\n<p>XHTML 1.0 \u63d0\u4f9b\u4e86\u4e09\u79cdDTD\u58f0\u660e\u53ef\u4f9b\u9009\u62e9\uff1a<\/p>\n<p>\u8fc7\u6e21\u7684(Transitional):\u8981\u6c42\u975e\u5e38\u5bbd\u677e\u7684DTD\uff0c\u5b83\u5141\u8bb8\u4f60\u7ee7\u7eed\u4f7f\u7528HTML4.01\u7684\u6807\u8bc6(\u4f46\u662f\u8981\u7b26\u5408xhtml\u7684\u5199\u6cd5)\u3002\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<p>&lt;!DOCTYPE html PUBLIC \u201c-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\u201d \u201chttp:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\u201c&gt;<\/p>\n<p>\u4e25\u683c\u7684(Strict):\u8981\u6c42\u4e25\u683c\u7684DTD\uff0c\u4f60\u4e0d\u80fd\u4f7f\u7528\u4efb\u4f55\u8868\u73b0\u5c42\u7684\u6807\u8bc6\u548c\u5c5e\u6027\uff0c\u4f8b\u5982&lt;br&gt;\u3002\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<p>&lt;!DOCTYPE html PUBLIC \u201c-\/\/W3C\/\/DTD XHTML 1.0 Strict\/\/EN\u201d \u201chttp:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-strict.dtd\u201c&gt;<\/p>\n<p>\u6846\u67b6\u7684(Frameset):\u4e13\u95e8\u9488\u5bf9\u6846\u67b6\u9875\u9762\u8bbe\u8ba1\u4f7f\u7528\u7684DTD\uff0c\u5982\u679c\u4f60\u7684\u9875\u9762\u4e2d\u5305\u542b\u6709\u6846\u67b6\uff0c\u9700\u8981\u91c7\u7528\u8fd9\u79cdDTD\u3002\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<p>&lt;!DOCTYPE html PUBLIC \u201c-\/\/W3C\/\/DTD XHTML 1.0 Frameset\/\/EN\u201d \u201chttp:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-frameset.dtd\u201c&gt;<\/p>\n<p>\u7406\u60f3\u60c5\u51b5\u5f53\u7136\u662f\u4e25\u683c\u7684DTD\uff0c\u4f46\u5bf9\u4e8e\u6211\u4eec\u5927\u591a\u6570\u521a\u63a5\u89e6web\u6807\u51c6\u7684\u8bbe\u8ba1\u5e08\u6765\u8bf4\uff0c\u8fc7\u6e21\u7684DTD(XHTML 1.0 Transitional)\u662f\u76ee\u524d\u7406\u60f3\u9009\u62e9(\u5305\u62ec\u672c\u7ad9\uff0c\u4f7f\u7528\u7684\u4e5f\u662f\u8fc7\u6e21\u578bDTD)\u3002\u56e0\u4e3a\u8fd9\u79cdDTD\u8fd8\u5141\u8bb8\u6211\u4eec\u4f7f\u7528\u8868\u73b0\u5c42\u7684\u6807\u8bc6\u3001\u5143\u7d20\u548c\u5c5e\u6027\uff0c\u4e5f\u6bd4\u8f83\u5bb9\u6613\u901a\u8fc7W3C\u7684\u4ee3\u7801\u6821\u9a8c\u3002<br \/>\n2. \u6307\u5b9a\u8bed\u8a00\u53ca\u5b57\u7b26\u96c6\uff1a<\/p>\n<p>\u4e3a\u6587\u6863\u6307\u5b9a\u8bed\u8a00\uff1a<\/p>\n<p>&lt;html xmlns=\u201dhttp:\/\/www.w3.org\/1999\/xhtml\u201d lang=\u201den\u201d&gt;<\/p>\n<p>\u4e3a\u4e86\u88ab\u6d4f\u89c8\u5668\u6b63\u786e\u89e3\u91ca\u548c\u901a\u8fc7W3C\u4ee3\u7801\u6821\u9a8c\uff0c\u6240\u6709\u7684XHTML\u6587\u6863\u90fd\u5fc5\u987b\u58f0\u660e\u5b83\u4eec\u6240\u4f7f\u7528\u7684\u7f16\u7801\u8bed\u8a00\uff1b\u5982\uff1a<br \/>\n\u5e38\u7528\u7684\u8bed\u8a00\u5b9a\u4e49\uff1a<\/p>\n<p>&lt;meta http-equiv=\u201dContent-Type\u201d content=\u201dtext\/html; charset=utf-8\u2033 \/&gt;<br \/>\n\u6807\u51c6\u7684XML\u6587\u6863\u8bed\u8a00\u5b9a\u4e49\uff1a<br \/>\n&lt;?xml version=\u201d1.0\u2033 encoding=\u201d utf-8\u2033?&gt;<br \/>\n\u9488\u5bf9\u8001\u7248\u672c\u7684\u6d4f\u89c8\u5668\u7684\u8bed\u8a00\u5b9a\u4e49\uff1a<br \/>\n&lt;meta http-equiv=\u201dContent-Language\u201d content=\u201d utf-8\u2033 \/&gt;<br \/>\n\u4e3a\u63d0\u9ad8\u5b57\u7b26\u96c6\uff0c\u5efa\u8bae\u91c7\u7528\u201cutf-8\u201d\u3002<\/p>\n<p>3. \u8c03\u7528\u6837\u5f0f\u8868\uff1a<\/p>\n<p>\u5916\u90e8\u6837\u5f0f\u8868\u8c03\u7528\uff1a<\/p>\n<p>\u9875\u9762\u5185\u5d4c\u6cd5\uff1a\u5c31\u662f\u5c06\u6837\u5f0f\u8868\u76f4\u63a5\u5199\u5728\u9875\u9762\u4ee3\u7801\u7684head\u533a\u3002 \u5982\uff1a<\/p>\n<p>&lt;style type=\u201dtext\/css\u201d&gt;&lt;!\u2013 body { background : white ; color : black ; } \u2013&gt; &lt;\/style&gt;<br \/>\n\u5916\u90e8\u8c03\u7528\u6cd5\uff1a\u5c06\u6837\u5f0f\u8868\u5199\u5728\u4e00\u4e2a\u72ec\u7acb\u7684.css\u6587\u4ef6\u4e2d\uff0c\u7136\u540e\u5728\u9875\u9762head\u533a\u7528\u7c7b\u4f3c\u4ee5\u4e0b\u4ee3\u7801\u8c03\u7528\u3002<\/p>\n<p>&lt;link rel=\u201dstylesheet\u201d rev=\u201dstylesheet\u201d href=\u201dcss\/style.css\u201d type=\u201dtext\/css\u201d media=\u201dall\u201d \/&gt;<\/p>\n<p>\u5728\u7b26\u5408web\u6807\u51c6\u7684\u8bbe\u8ba1\u4e2d\uff0c\u63a8\u8350\u4f7f\u7528\u5916\u90e8\u8c03\u7528\u6cd5\uff0c\u53ef\u4ee5\u4e0d\u4fee\u6539\u9875\u9762\u53ea\u4fee\u6539.css\u6587\u4ef6\u800c\u6539\u53d8\u9875\u9762\u7684\u6837\u5f0f\u3002\u5982\u679c\u6240\u6709\u9875\u9762\u90fd\u8c03\u7528\u540c\u4e00\u4e2a\u6837\u5f0f\u8868\u6587\u4ef6\uff0c\u90a3\u4e48\u6539\u4e00\u4e2a\u6837\u5f0f\u8868\u6587\u4ef6\uff0c\u53ef\u4ee5\u6539\u53d8\u6240\u6709\u6587\u4ef6\u7684\u6837\u5f0f\u3002<\/p>\n<p>4\u3001\u9009\u7528\u6070\u5f53\u7684\u5143\u7d20\uff1a<\/p>\n<p>\u6839\u636e\u6587\u6863\u7684\u7ed3\u6784\u6765\u9009\u62e9HTML\u5143\u7d20\uff0c\u800c\u4e0d\u662f\u6839\u636eHTML\u5143\u7d20\u7684\u6837\u5f0f\u6765\u9009\u62e9\u3002\u4f8b\u5982\uff0c\u4f7f\u7528P\u5143\u7d20\u6765\u5305\u542b\u6587\u5b57\u6bb5\u843d\uff0c\u800c\u4e0d\u662f\u4e3a\u4e86\u6362\u884c\u3002\u5982\u679c\u5728\u521b\u5efa\u6587\u6863\u65f6\u627e\u4e0d\u5230\u9002\u5f53\u7684\u5143\u7d20\uff0c\u5219\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u901a\u7528\u7684div \u6216\u8005\u662fspan\uff1b<\/p>\n<p>\u907f\u514d\u8fc7\u6e21\u4f7f\u7528div\u548cspan\u3002\u5c11\u91cf\u3001\u9002\u5f53\u7684\u4f7f\u7528div\u548cspan\u5143\u7d20\u53ef\u4ee5\u4f7f\u6587\u6863\u7684\u7ed3\u6784\u66f4\u52a0\u6e05\u6670\u5408\u7406\u5e76\u4e14\u6613\u4e8e\u4f7f\u7528\u6837\u5f0f\uff1b<\/p>\n<p>\u5c3d\u53ef\u80fd\u5c11\u5730\u4f7f\u7528\u6807\u7b7e\u548c\u7ed3\u6784\u5d4c\u5957\uff0c\u8fd9\u6837\u4e0d\u4f46\u53ef\u4ee5\u4f7f\u6587\u6863\u7ed3\u6784\u6e05\u6670\uff0c\u540c\u65f6\u4e5f\u53ef\u4ee5\u4fdd\u6301\u6587\u4ef6\u7684\u5c0f\u5de7\uff0c\u5728\u63d0\u9ad8\u7528\u6237\u4e0b\u8f7d\u901f\u5ea6\u7684\u540c\u65f6\uff0c\u4e5f\u6613\u4e8e\u6d4f\u89c8\u5668\u5bf9\u6587\u6863\u7684\u89e3\u91ca\u53ca\u5448\u89c6\uff1b<\/p>\n<p>5\u3001\u6d3e\u751f\u9009\u62e9\u5668\uff1a<\/p>\n<p>\u53ef\u4ee5\u4f7f\u7528\u6d3e\u751f\u9009\u62e9\u5668\u7ed9\u4e00\u4e2a\u5143\u7d20\u91cc\u7684\u5b50\u5143\u7d20\u5b9a\u4e49\u6837\u5f0f\uff0c\u5728\u7b80\u5316\u547d\u540d\u7684\u540c\u65f6\u4e5f\u4f7f\u7ed3\u6784\u66f4\u52a0\u7684\u6e05\u6670\u5316\uff0c\u5982\uff1a<\/p>\n<p>.mainMenu ul li {background:url(images\/bg.gif;)}<br \/>\n6\u3001\u8f85\u52a9\u56fe\u7247\u7528\u80cc\u5f71\u56fe\u5904\u7406\uff1a<\/p>\n<p>\u8fd9\u91cc\u7684\u201d\u8f85\u52a9\u56fe\u7247\u201d\u662f\u6307\u90a3\u4e9b\u4e0d\u662f\u4f5c\u4e3a\u9875\u9762\u8981\u8868\u8fbe\u7684\u5185\u5bb9\u7684\u4e00\u90e8\u5206\uff0c\u800c\u4ec5\u4ec5\u7528\u4e8e\u4fee\u9970\u3001\u95f4\u9694\u3001\u63d0\u9192\u7684\u56fe\u7247\u3002\u5c06\u5176\u505a\u80cc\u5f71\u56fe\u5904\u7406\uff0c\u53ef\u4ee5\u5728\u4e0d\u6539\u52a8\u9875\u9762\u7684\u60c5\u51b5\u4e0b\u901a\u8fc7CSS\u6837\u5f0f\u6765\u8fdb\u884c\u6539\u52a8\uff0c\u5982\uff1a<\/p>\n<p>#logo {background:url(images\/logo.jpg) #FEFEFE no-repeat right bottom;}<\/p>\n<p>7\u3001\u7ed3\u6784\u4e0e\u6837\u5f0f\u5206\u79bb\uff1a<\/p>\n<p>\u5728\u9875\u9762\u91cc\u53ea\u5199\u5165\u6587\u6863\u7684\u7ed3\u6784\uff0c\u800c\u5c06\u6837\u5f0f\u5199\u4e8ecss\u6587\u4ef6\u4e2d\uff0c\u901a\u8fc7\u5916\u90e8\u8c03\u7528CSS\u6837\u5f0f\u8868\u6765\u5b9e\u73b0\u7ed3\u6784\u4e0e\u6837\u5f0f\u7684\u5206\u79bb\u3002<\/p>\n<p>8\u3001\u6587\u6863\u7684\u7ed3\u6784\u5316\u4e66\u5199\uff1a<\/p>\n<p>\u9875\u9762CSS\u6587\u6863\u90fd\u5e94\u91c7\u7528\u7ed3\u6784\u5316\u7684\u4e66\u5199\u65b9\u5f0f\uff0c\u903b\u8f91\u6e05\u6670\u6613\u4e8e\u9605\u8bfb\u3002\u5982\uff1a<\/p>\n<p>&lt;div id=\u201dmainMenu\u201d&gt;<br \/>\n&lt;ul&gt;<br \/>\n&lt;li&gt;&lt;a href=\u201d#\u201d &gt;\u9996\u9875&lt;\/a&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;a href=\u201d#\u201d &gt;\u4ecb\u7ecd&lt;\/a&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;a href=\u201d#\u201d &gt;\u670d\u52a1&lt;\/a&gt;&lt;\/li&gt;<br \/>\n&lt;\/ul&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>\/*=====\u4e3b\u5bfc\u822a=====*\/<br \/>\n#mainMenu {<br \/>\nwidth:100%;<br \/>\nheight:30px;<br \/>\nbackground:url(images\/mainMenu_bg.jpg) repeat-x;<br \/>\n}<br \/>\n#mainMenu ul li {<br \/>\nfloat:left;<br \/>\nline-height:30px;<br \/>\nmargin-right:1px;<br \/>\ncursor:pointer;<br \/>\n}<br \/>\n\/*=====\u4e3b\u5bfc\u822a\u7ed3\u675f=====*\/<\/p>\n<p>9\u3001\u9f20\u6807\u624b\u52bf\uff1a<\/p>\n<p>\u5728XHTML\u6807\u51c6\u4e2d\uff0chand\u53ea\u88abIE\u8bc6\u522b\uff0c\u5f53\u9700\u8981\u5c06\u9f20\u6807\u624b\u52bf\u8f6c\u6362\u4e3a\u201c\u624b\u5f62\u201d\u65f6\uff0c\u5219\u5c06\u201chand\u201d\u6362\u4e3a\u201cpointer\u201d\uff0c\u5373\u201ccursor:pointer;\u201d<\/p>\n<p><strong>\u4e8c\uff0e\u6ce8\u91ca\u4e66\u5199\u89c4\u8303<\/strong><\/p>\n<p>1\u3001\u884c\u95f4\u6ce8\u91ca\uff1a<\/p>\n<p>\u76f4\u63a5\u5199\u4e8e\u5c5e\u6027\u503c\u540e\u9762\uff0c\u5982\uff1a<\/p>\n<p>.search{<br \/>\nborder:1px solid #fff;\/*\u5b9a\u4e49\u641c\u7d22\u8f93\u5165\u6846\u8fb9\u6846*\/<br \/>\nbackground:url(..\/images\/icon.gif) no-report #333;\/*\u5b9a\u4e49\u641c\u7d22\u6846\u7684\u80cc\u666f*\/<br \/>\n}<\/p>\n<p>2\u3001\u6574\u6bb5\u6ce8\u91ca\uff1a<\/p>\n<p>\u5206\u522b\u5728\u5f00\u59cb\u53ca\u7ed3\u675f\u5730\u65b9\u52a0\u5165\u6ce8\u91ca\uff0c\u5982\uff1a<\/p>\n<p>\/*=====\u641c\u7d22\u6761=====*\/<br \/>\n.search {<br \/>\nborder:1px solid #fff;<br \/>\nbackground:url(..\/images\/icon.gif) no-repeat #333;<br \/>\n}<br \/>\n\/*=====\u641c\u7d22\u6761\u7ed3\u675f=====*\/<br \/>\n\u4e09\uff0e\u6837\u5f0f\u5c5e\u6027\u4ee3\u7801\u7f29\u5199<\/p>\n<p>1\u3001\u4e0d\u540c\u7c7b\u6709\u76f8\u540c\u5c5e\u6027\u53ca\u5c5e\u6027\u503c\u7684\u7f29\u5199\uff1a<\/p>\n<p>\u5bf9\u4e8e\u4e24\u4e2a\u4e0d\u540c\u7684\u7c7b\uff0c\u4f46\u662f\u5176\u4e2d\u6709\u90e8\u5206\u76f8\u540c\u751a\u81f3\u662f\u5168\u90e8\u76f8\u540c\u7684\u5c5e\u6027\u53ca\u5c5e\u6027\u503c\u65f6\uff0c\u5e94\u5bf9\u5176\u52a0\u4ee5\u5408\u5e76\u7f29\u5199\uff0c\u7279\u522b\u662f\u5f53\u6709\u591a\u4e2a\u4e0d\u540c\u7684\u7c7b\u800c\u6709\u76f8\u540c\u7684\u5c5e\u6027\u53ca\u5c5e\u6027\u503c\u65f6\uff0c\u5408\u5e76\u7f29\u5199\u53ef\u4ee5\u51cf\u5c11\u4ee3\u7801\u91cf\u5e76\u6613\u4e8e\u63a7\u5236\u3002\u5982\uff1a<\/p>\n<p>#mainMenu {<br \/>\nbackground:url(..\/images\/bg.gif);<br \/>\nborder:1px solid #333;<br \/>\nwidth:100%;<br \/>\nheight:30px;<br \/>\noverflow:hidden;<br \/>\n}<br \/>\n#subMenu {<br \/>\nbackground:url(..\/images\/bg.gif);<br \/>\nborder:1px solid #333;<br \/>\nwidth:100%;<br \/>\nheight:20px;<br \/>\noverflow:hidden;<br \/>\n}<\/p>\n<p>\u4e24\u4e2a\u4e0d\u540c\u7c7b\u7684\u5c5e\u6027\u503c\u6709\u91cd\u590d\u4e4b\u5904\uff0c\u521a\u53ef\u4ee5\u7f29\u5199\u4e3a\uff1a<\/p>\n<p>#mainMenu,#subMenu {<br \/>\nbackground:url(..\/images\/bg.gif);<br \/>\nborder:1px solid #333;<br \/>\nwidth:100%;<br \/>\noverflow:hidden;<br \/>\n}<br \/>\n#mainMenu {height:30px;}<br \/>\n#subMenu {height:20px;}<\/p>\n<p>2\u3001\u540c\u4e00\u5c5e\u6027\u7684\u7f29\u5199\uff1a<\/p>\n<p>\u540c\u4e00\u5c5e\u6027\u6839\u636e\u5b83\u7684\u5c5e\u6027\u503c\u4e5f\u53ef\u4ee5\u8fdb\u884c\u7b80\u5199\uff0c\u5982\uff1a<\/p>\n<p>.search {<br \/>\nbackground-color:#333;<br \/>\nbackground-image:url(..\/images\/icon.gif);<br \/>\nbackground-repeat: no-repeat;<br \/>\nbackground-position:50% 50%;<br \/>\n}<br \/>\n.search {<br \/>\nbackground:#333 url(..\/images\/icon.gif) no-repeat 50% 50%;<br \/>\n}<\/p>\n<p>3\u3001\u5185\u5916\u4fa7\u8fb9\u6846\u7684\u7f29\u5199\uff1a<\/p>\n<p>\u5728CSS\u4e2d\u5173\u4e8e\u5185\u5916\u4fa7\u8fb9\u6846\u7684\u8ddd\u79bb\u662f\u6309\u7167\u4e0a\u3001\u53f3\u3001\u4e0b\u3001\u5de6\u7684\u987a\u5e8f\u6765\u6392\u5217\u7684\uff0c\u5f53\u8fd9\u56db\u4e2a\u5c5e\u6027\u503c\u4e0d\u540c\u65f6\u4e5f\u53ef\u76f4\u63a5\u7f29\u5199\uff0c\u5982\uff1a<\/p>\n<p>.btn {<br \/>\nmargin-top:10px;<br \/>\nmargin-right:8px;<br \/>\nmargin-bottom:12px;<br \/>\nmargin-left:5px;<br \/>\npadding-top:10px;<br \/>\npadding-right:8px;<br \/>\npadding-bottom:12px;<br \/>\npadding-left:8px;<br \/>\n}<\/p>\n<p>\u5219\u53ef\u7f29\u5199\u4e3a\uff1a<\/p>\n<p>.btn {<br \/>\nMargin:10px 8px 12px 5px;<br \/>\nPadding:10px 8px 12px 5px;<br \/>\n}<\/p>\n<p>\u800c\u5982\u679c\u5f53\u4e0a\u8fb9\u4e0e\u4e0b\u8fb9\u3001\u5de6\u8fb9\u4e0e\u53f3\u8fb9\u7684\u8fb9\u6846\u5c5e\u6027\u503c\u76f8\u540c\u65f6\uff0c\u5219\u5c5e\u6027\u503c\u53ef\u4ee5\u76f4\u63a5\u7f29\u5199\u4e3a\u4e24\u4e2a\uff0c\u5982\uff1a<\/p>\n<p>.btn {<br \/>\nmargin-top:10px;<br \/>\nmargin-right:5px;<br \/>\nmargin-bottom:10px;<br \/>\nmargin-left:5px;<br \/>\n}<\/p>\n<p>\u7f29\u5199\u4e3a\uff1a<\/p>\n<p>.btn {margin:10px 5px;}<\/p>\n<p>\u800c\u5f53\u4e0a\u4e0b\u5de6\u53f3\u56db\u4e2a\u8fb9\u6846\u7684\u5c5e\u6027\u503c\u90fd\u76f8\u540c\u65f6\uff0c\u5219\u53ef\u4ee5\u76f4\u63a5\u7f29\u5199\u6210\u4e00\u4e2a\uff0c\u5982\uff1a<\/p>\n<p>.btn {<br \/>\nmargin-top:10px;<br \/>\nmargin-right:10px;<br \/>\nmargin-bottom:10px;<br \/>\nmargin-left:10px;<br \/>\n}<\/p>\n<p>\u7f29\u5199\u4e3a\uff1a<\/p>\n<p>.btn{margin:10px;}<\/p>\n<p>4\u3001\u989c\u8272\u503c\u7684\u7f29\u5199\uff1a<\/p>\n<p>\u5f53RGB\u4e09\u4e2a\u989c\u8272\u503c\u6570\u503c\u76f8\u540c\u65f6\uff0c\u53ef\u7f29\u5199\u989c\u8272\u503c\u4ee3\u7801\u3002\u5982\uff1a<\/p>\n<p>.menu { color:#ff3333;}<\/p>\n<p>\u53ef\u7f29\u5199\u4e3a:<\/p>\n<p>.menu {color:#f33;}<br \/>\n\u56db\uff0ehack\u4e66\u5199\u89c4\u8303<\/p>\n<p>\u56e0\u4e3a\u4e0d\u540c\u6d4f\u89c8\u5668\u5bf9W3C\u6807\u51c6\u7684\u652f\u6301\u4e0d\u4e00\u6837\uff0c\u5404\u4e2a\u6d4f\u89c8\u5668\u5bf9\u4e8e\u9875\u9762\u7684\u89e3\u91ca\u5448\u89c6\u4e5f\u4e0d\u5c3d\u76f8\u540c\uff0c\u6bd4\u5982IE\u5728\u5f88\u591a\u60c5\u51b5\u4e0b\u5c31\u4e0eFF\u5b58\u57283px\u7684\u5dee\u8ddd\uff0c\u5bf9\u4e8e\u8fd9\u4e9b\u5dee\u5f02\u6027\uff0c\u5c31\u9700\u8981\u5229\u7528css \u7684hack\u6765\u8fdb\u884c\u8c03\u6574\uff0c\u5f53\u7136\u5728\u6ca1\u6709\u5fc5\u8981\u7684\u60c5\u51b5\u4e0b\uff0c\u6700\u597d\u4e0d\u8981\u5199hack\u6765\u8fdb\u884c\u8c03\u6574\uff0c\u907f\u514d\u56e0\u4e3ahack\u800c\u5bfc\u81f4\u9875\u9762\u51fa\u73b0\u95ee\u9898\u3002<\/p>\n<p><strong>\u4e09\u3001 IE6\u3001IE7\u3001Firefox\u4e4b\u95f4\u7684\u517c\u5bb9\u5199\u6cd5\uff1a<\/strong><\/p>\n<p>\u5199\u6cd5\u4e00\uff1a<\/p>\n<p>IE\u90fd\u80fd\u8bc6\u522b*;\u6807\u51c6\u6d4f\u89c8\u5668(\u5982FF)\u4e0d\u80fd\u8bc6\u522b*\uff1b<br \/>\nIE6\u80fd\u8bc6\u522b*\uff0c\u4f46\u4e0d\u80fd\u8bc6\u522b !important,<br \/>\nIE7\u80fd\u8bc6\u522b*\uff0c\u4e5f\u80fd\u8bc6\u522b!important;<br \/>\nFF\u4e0d\u80fd\u8bc6\u522b*\uff0c\u4f46\u80fd\u8bc6\u522b!important;<br \/>\n\u6839\u636e\u4e0a\u8ff0\u8868\u8fbe\uff0c\u540c\u4e00\u7c7b\/ID\u4e0b\u7684CSS \u3000hack\u53ef\u5199\u4e3a\uff1a<br \/>\n.searchInput {<br \/>\nbackground-color:#333;\/*\u4e09\u8005\u7686\u53ef*\/<br \/>\n*background-color:#666\u3000!important; \/*\u4ec5IE7*\/<br \/>\n*background-color:#999; \/*\u4ec5IE6\u53caIE6\u4ee5\u4e0b*\/<br \/>\n}<br \/>\n\u4e00\u822c\u4e09\u8005\u7684\u4e66\u5199\u987a\u5e8f\u4e3a\uff1aFF\u3001IE7\u3001IE6.<\/p>\n<p>\u5199\u6cd5\u4e8c\uff1a<\/p>\n<p>IE6\u53ef\u8bc6\u522b\u201c_\u201d\uff0c\u800cIE7\u53caFF\u7686\u4e0d\u80fd\u8bc6\u522b\uff0c\u6240\u4ee5\u5f53\u53ea\u9488\u5bf9IE6\u4e0eIE7\u53caFF\u4e4b\u95f4\u7684\u533a\u522b\u65f6\uff0c\u53ef\u8fd9\u6837\u4e66\u5199\uff1a<br \/>\n.searchInput {<br \/>\nbackground-color:#333;\/*\u901a\u7528*\/<br \/>\n_background-color:#666;\/*\u4ec5IE6\u53ef\u8bc6\u522b*\/<br \/>\n}<\/p>\n<p>\u5199\u6cd5\u4e09\uff1a<\/p>\n<p>*+html \u4e0e *html \u662fIE\u7279\u6709\u7684\u6807\u7b7e, Firefox \u6682\u4e0d\u652f\u6301\u3002<br \/>\n.searchInput {background-color:#333;}<br \/>\n*html .searchInput {background-color:#666;}\/*\u4ec5IE6*\/<br \/>\n*+html .searchInput {background-color:#555;}\/*\u4ec5IE7*\/<\/p>\n<p>\u5c4f\u853dIE\u6d4f\u89c8\u5668\uff1a<\/p>\n<p>select\u662f\u9009\u62e9\u7b26\uff0c\u6839\u636e\u60c5\u51b5\u66f4\u6362\u3002\u7b2c\u4e8c\u53e5\u662fMAC\u4e0asafari\u6d4f\u89c8\u5668\u72ec\u6709\u7684\u3002<\/p>\n<p>*:lang(zh) select {font:12px\u00a0 !important;} \/*FF\u7684\u4e13\u7528*\/<br \/>\nselect:empty {font:12px\u00a0 !important;} \/*safari\u53ef\u89c1*\/<\/p>\n<p>IE6\u53ef\u8bc6\u522b\uff1a<\/p>\n<p>\u8fd9\u91cc\u4e3b\u8981\u662f\u901a\u8fc7CSS\u6ce8\u91ca\u5206\u5f00\u4e00\u4e2a\u5c5e\u6027\u4e0e\u503c\uff0c\u6ce8\u91ca\u5728\u5192\u53f7\u524d\u3002<\/p>\n<p>select { display \/*IE6\u4e0d\u8bc6\u522b*\/:none;}<\/p>\n<p>IE\u7684if\u6761\u4ef6hack\u5199\u6cd5\uff1a<\/p>\n<p>\u6240\u6709\u7684IE\u53ef\u8bc6\u522b\uff1a<\/p>\n<p>&lt;!\u2013[if IE]&gt; Only IE &lt;![end if]\u2013&gt;<br \/>\n\u53ea\u6709IE5.0\u53ef\u4ee5\u8bc6\u522b:<br \/>\n&lt;!\u2013[if IE 5.0]&gt; Only IE 5.0 &lt;![end if]\u2013&gt;<br \/>\nIE5.0\u5305\u6362IE5.5\u90fd\u53ef\u4ee5\u8bc6\u522b:<br \/>\n&lt;!\u2013[if gt IE 5.0]&gt; Only IE 5.0+ &lt;![end if]\u2013&gt;<br \/>\n\u4ec5IE6\u53ef\u8bc6\u522b:<br \/>\n&lt;!\u2013[if lt IE 6]&gt; Only IE 6- &lt;![end if]\u2013&gt;<br \/>\nIE6\u4ee5\u53caIE6\u4ee5\u4e0b\u7684IE5.x\u90fd\u53ef\u8bc6\u522b:<br \/>\n&lt;!\u2013[if gte IE 6]&gt; Only IE 6\/+ &lt;![end if]\u2013&gt;<br \/>\n\u4ec5IE7\u53ef\u8bc6\u522b:<br \/>\n&lt;!\u2013[if lte IE 7]&gt; Only IE 7\/- &lt;![end if]\u2013&gt;<\/p>\n<p>2\u3001\u6e05\u9664\u6d6e\u52a8\uff1a<\/p>\n<p>\u5728Firefox\u4e2d\uff0c\u5f53\u5b50\u7ea7\u90fd\u4e3a\u6d6e\u52a8\u65f6\uff0c\u90a3\u4e48\u7236\u7ea7\u7684\u9ad8\u5ea6\u5c31\u65e0\u6cd5\u5b8c\u5168\u7684\u5305\u4f4f\u6574\u4e2a\u5b50\u7ea7\uff0c\u90a3\u4e48\u8fd9\u65f6\u7528\u8fd9\u4e2a\u6e05\u9664\u6d6e\u52a8\u7684HACK\u6765\u5bf9\u7236\u7ea7\u505a\u4e00\u6b21\u5b9a\u4e49\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n<p>select:after {<br \/>\ncontent:\u201d.\u201d;<br \/>\ndisplay:block;<br \/>\nheight:0;<br \/>\nclear:both;<br \/>\nvisibility:hidden;<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6d4f\u89c8\u7f51\u9875\u4f1a\u51fa\u73b0\u7ed3\u6784\u4e0d\u51c6\u786e\u7684\u72b6\u51b5\uff0c\u5e38\u5e38\u56e0\u4e3a\u4e66\u5199\u7f51\u9875\u4e0d\u89c4\u8303\u9020\u6210\u3002\u4fd7\u8bdd\u8bf4\uff0c\u6ca1\u6709\u89c4\u77e9\u4e0d\u6210\u65b9\u5706\uff0c\u6240\u6709\u7684\u4e8b\u60c5\u9075\u5faa\u7740\u4e00\u4e2a\u826f\u597d\u7684\u89c4\u5f8b\uff0c\u4f1a\u4e8b\u534a\u529f\u500d\u8bb8\u591a\u3002\u4e00\u4e2a\u826f\u597d\u7684\u4e66\u5199\u89c4\u8303\uff0c\u4e0d\u4ec5\u4ec5\u80fd\u51cf\u5c11\u9519\u8bef\uff0c\u4e5f\u65b9\u4fbf\u4e86\u5927\u5bb6\u548c\u81ea\u5df1\u7684\u67e5\u770b\uff0c\u8ba9\u4ee3\u7801\u66f4\u4e3a\u660e\u4e86\u3002 \u4e0b\u9762\u5c31\u4ecb\u7ecd\u4e00\u4e9bDIV+CSS\u7f51\u9875\u5e03\u5c40\u5e38\u7528\u7684\u4e66\u5199\u89c4\u8303\uff1a<\/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":[20,44,19],"class_list":["post-42","post","type-post","status-publish","format-standard","hentry","category-program","tag-css","tag-divcss","tag-web-page"],"_links":{"self":[{"href":"https:\/\/www.bluesdream.com\/blog\/wp-json\/wp\/v2\/posts\/42"}],"collection":[{"href":"https:\/\/www.bluesdream.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bluesdream.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bluesdream.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bluesdream.com\/blog\/wp-json\/wp\/v2\/comments?post=42"}],"version-history":[{"count":0,"href":"https:\/\/www.bluesdream.com\/blog\/wp-json\/wp\/v2\/posts\/42\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bluesdream.com\/blog\/wp-json\/wp\/v2\/media?parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bluesdream.com\/blog\/wp-json\/wp\/v2\/categories?post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bluesdream.com\/blog\/wp-json\/wp\/v2\/tags?post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}