通常來講是針對不一樣的瀏覽器寫不一樣的CSS,就是 CSS Hack。php
IE瀏覽器Hack通常又分爲三種,條件Hack、屬性級Hack、選擇符Hack(詳細參考CSS文檔:css文檔)。例如:css
// 一、條件Hack
<!--[if IE]> <style> .test{color:red;} </style> <![endif]--> // 二、屬性Hack .test{ color:#090\9; /* For IE8+ */ *color:#f00; /* For IE7 and earlier */ _color:#ff0; /* For IE6 and earlier */ } // 三、選擇符Hack * html .test{color:#090;} /* For IE6 and earlier */ * + html .test{color:#ff0;} /* For IE7 */
塊級元素:div、ul、li、dl、dt、dd、p、h1-h六、blockquotehtml
空元素:即系沒有內容的HTML元素,例如:br、meta、hr、link、input、imgcss3