IE浏览器样式专属hack写法
hack对照表,Q为怪癖模式,S为标准模式
在标准模式中:
"_"或"-" IE6专属
"*"或"+"或"#" IE6 IE7
"\0" IE8 IE9 IE10
"\9" IE6-IE10 (从别处看到的,具体没有测试过)
"\9\0" IE9 IE10
"!important" IE7~IE10
background-color:#f00;/*all*/
background-color:#0ff\0;/* ie 8/9 */
background-color:#0f0\9\0;/* ie9 */
*background-color:#00f;/*ie7*/
_background-color:#ff0;/*ie6*/
background-color//:#090;/*非IE*/
background-color:#900\9;/*所有ie*/
条件注释
条件注释只在IE9及以下版本中支持,从IE10起就不再支持
<!--[if IE]>
<p>识别IE10以下浏览器</p>
<![endif]-->
<!--[if IE 8]>
<p>指定识别IE8浏览器</p>
<![endif]-->
<!--[if lte IE 8]>
<p>识别小于等于IE8浏览器</p>
<![endif]-->
<!--[if lt IE 8]>
<p>识别小于IE8的浏览器</p>
<![endif]-->
<!--[if gte IE 8]>
<p>识别大于等于IE8的浏览器</p>
<![endif]-->
<!--[if gt IE 8]>
<p>识别大于IE8的浏览器</p>
<![endif]-->
<!--[if !IE 8>
<p>识别非IE8的浏览器</p>
<![endif]-->