IE6:_selector{property:value;}selector{property:value;property:value !important;} //IE6 不支持同一选择符中的 !importantIE7:+selector{property:value;}IE8:selector{property:value\0;}IE6 & IE7:*selector{property:value;}IE6 & IE7 & IE8:selector{property:value\9;}
hack | 示例 | IE6(S) | IE6(Q) | IE7(S) | IE7(Q) | IE8(S) | IE8(Q) |
* | *color | Yes | Yes | Yes | Yes | No | Yes |
+ | +color | Yes | Yes | Yes | Yes | No | Yes |
- | -color | Yes | Yes | No | No | No | No |
_ | _color | Yes | Yes | No | Yes | No | Yes |
# | #color | Yes | Yes | Yes | Yes | No | Yes |
\0 | color\0 | No | No | No | No | Yes | No |
\9 | color\9 | Yes | Yes | Yes | Yes | Yes | Yes |
!important | color:blue !important; color:green; | No | No | Yes | No | Yes | No |
<!--[if IE]> 所有的IE可识别 <![endif]-->
<!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]-->
<!--[if IE 6]> 仅IE6可识别 <![endif]-->
<!--[if lt IE 6]> IE6以下版本可识别 <![endif]-->
<!--[if gte IE 6]> IE6以及IE6以上版本可识别 <![endif]-->
<!--[if IE 7]> 仅IE7可识别 <![endif]-->
<!--[if lt IE 7]> IE7以下版本可识别 <![endif]-->
<!--[if gte IE 7]> IE7以及IE7以上版本可识别 <![endif]-->
<!--[if IE 8]> 仅IE8可识别 <![endif]-->
<!--[if IE 9]> 仅IE9可识别 <![endif]-->
<meta http-equiv="X-UA-Compatible" content="IE=7"> //标准 IE7 模式<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"> //兼容 IE7 模式<meta http-equiv="X-UA-Compatible" content="IE=Edge">//标准 IE 模式
.color1{ color:#F00; color/*\**/:#00F /*\**/}/*IE6,IE7,IE8,FF,OP,SA识别*/
.color2{ color:#F00; color /*\**/:#00F /*\9**/}/*IE7,IE8,FF,OP,SA识别*/
.color3{ color:#F00; color/*\**/:#00F \9}/*IE6,IE7,IE8识别*/
.color4{ color:#F00; color /*\**/:#00F\9}/*IE7,IE8识别*//*“color”和“/*\**/”之间有个空格*/转自请注明文章转自五月兰博客:http://www.wuyuelan.com/1322