本文使用「署名 4.0 国际 (CC BY 4.0)」许可协议,欢迎转载、或重新修改使用,但需要注明来源。 [署名 4.0 国际 (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/deed.zh) 本文作者: 苏洋 创建时间: 2009年04月07日 统计字数: 612字 阅读时间: 2分钟阅读 本文链接: https://soulteary.com/2009/04/07/css-hack.html ----- # [css]CSS Hack区别对待浏览器 IE6与FireFox[FireFox在前,IE6在后] ```css background:orange;*background:blue; ``` IE6与IE7[IE6在后] ```css background:green !important;background:blue; ``` IE7与FireFox[IE在后] ```css background:orange; *background:green; ``` 区别FireFox,IE7,IE6[FireFox在前,IE7在中间,IE6最后] ```css background:orange; *background:green!important; *background:blue; ``` 区别FireFox,IE7,IE6[FireFox在前,IE7在中间,IE6最后] ```css background:orange; *background:green; _background:blue; ``` ## 总结 ``` IE都能识别*;标准浏览器(如FF)不能识别*; IE6能识别*,但不识别!important, IE7能识别*,也能识别!important; FF不能识别*,但能识别!important; IE6支持下划线_,IE7和firefox均不支持下划线_。 不论什么方法,顺序都是firefox的写在前面,IE7的写在中间,IE6的写在最后面。 ```