随着IE7对!important的支持, !important 方法现在只针对IE6(注意写法.记得该声明位置需要提前)
<style type="text/css">
div
{
color:#F00!important;/* IE7+ 其他浏览器 */
color:#00F;/* IE6 */
}
</style>
<div>文字</div>
2、*+html 与 *html
*+html 与 *html 是IE特有的标签, 而*+html 又为 IE7特有标签
<style type="text/css">
div
{
color:#F00; /* 其他浏览器 */
}
*html div
{
color:#00F; /* IE6 */
}
*+html div
{
color:#0F0; /* IE7,注意顺序 */
}
</style>
<div>文字</div>
3、下划线_(不能通过W3C的验证,针对IE6)
IE6 | IE7 | FF | |
* | √ | √ | × |
!important | × | √ | √ |
_ | √ | × | × |