当你想在一个浏览器里改变样式而不像在其他浏览器中改变时,这些选择器很有用。
IE6以下
![div css xhtml xml Example Source Code](http://www.52css.com/images/quote.gif)
*html{}
IE 7 以下
![div css xhtml xml Example Source Code](http://www.52css.com/images/quote.gif)
*:first-child+html {} * html {}
只对IE 7
![div css xhtml xml Example Source Code](http://www.52css.com/images/quote.gif)
*:first-child+html {}
只对IE 7 和现代浏览器
![div css xhtml xml Example Source Code](http://www.52css.com/images/quote.gif)
html>body {}
只对现代浏览器(非IE 7)
![div css xhtml xml Example Source Code](http://www.52css.com/images/quote.gif)
html>/**/body {}
最新的Opera 9以下版本
![div css xhtml xml Example Source Code](http://www.52css.com/images/quote.gif)
html:first-child {}
Safari
![div css xhtml xml Example Source Code](http://www.52css.com/images/quote.gif)
html[xmlns*=”"] body:last-child {}
要使用这些选择器,请在样式前写下这些代码。例如:
![div css xhtml xml Example Source Code](http://www.52css.com/images/quote.gif)
#content-box {
width: 300px;
height: 150px;
}
* html #content-box {
width: 250px;
}
/* 重写上面的代码并且把宽度改为250PX
在IE6以下版本中适用。 */
width: 300px;
height: 150px;
}
* html #content-box {
width: 250px;
}
/* 重写上面的代码并且把宽度改为250PX
在IE6以下版本中适用。 */
IE8 最新css hack:
"/9" 例:"margin:0px auto/9;" .这里的"/9"可以区别所有IE和FireFox.
"*" IE6、IE7可以识别.IE8、FireFox不能.
"_" IE6可以识别"_",IE7、IE8、FireFox不能.