HACK原理:不同浏览器对各中字符的识别不同 (读完文章你会发现,FF和IE8对以下字符的识别能力完全相同)
在 CSS中常用特殊字符识别表:
(1)*:
(2)!important:除IE6不能识别
(3)_
(4)\9:所有IE浏览器都识别(IE6、IE7、IE8、IE9)
示例:
(1)区别FF(IE8)与IE6 IE7
backgorund:orange;
*backgorund:red;
(2)区别FF(IE8)与IE6与IE7
background:orange;
*background:red!important;
*background:blue;
(3)区别FF(IE8)与IE6与IE7
background:orange;
*background:red;
_background:blue;
(4)区别FF与IE6 IE7 E8
color:gray;
color:red\9;
*color:green;
_color:blue;
提示:CSS HACK书写顺序:先写FF等非IE浏览器所需样式,其次写IE8所需样式,接着是IE7的,再接着才是IE6的!