Tim*_*Tim 22 html css stylesheet css-hack internet-explorer-9
只是想知道这些IE黑客入侵我的技巧
"\9" - for IE8 and below.
"*" - for IE7 and below.
"_" - for IE6.
Run Code Online (Sandbox Code Playgroud)
即如
body {
border:2px solid blue;
border:2px solid yellow \9;
*border:2px solid green;
_border:2px solid orange;
}
Run Code Online (Sandbox Code Playgroud)
是否有人对IE9有这样的攻击?即我只是想通过CSS瞄准IE9?
Jef*_*ski 42
可怕,但它应该工作:
body {
border:2px solid blue;
border:2px solid yellow \9;
*border:2px solid green;
_border:2px solid orange;
}
body:nth-child(n) {border:1px solid purple \9; /*Should target IE9 only - not fully tested.*/}
Run Code Online (Sandbox Code Playgroud)
med*_*iev 29
我建议使用condcoms来提供IE9 css文件或者有一个条件html类,类似于:
<!--[if lt IE 7]> <html lang="en-us" class="no-js ie6"> <![endif]-->
<!--[if IE 7]> <html lang="en-us" class="no-js ie7"> <![endif]-->
<!--[if IE 8]> <html lang="en-us" class="no-js ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en-us" class="no-js"> <!--<![endif]-->
Run Code Online (Sandbox Code Playgroud)