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