现在的位置: 首页 > 综合 > 正文

css hack

2014年02月20日 ⁄ 综合 ⁄ 共 648字 ⁄ 字号 评论关闭

 IE6以下
*html{}

IE 7 以下
*:first-child+html {} * html {}

只对IE 7
*:first-child+html {}

只对IE 7 和现代浏览器
html>body {}

只对现代浏览器(非IE 7)
html>/**/body {}

最新的Opera 9以下版本
html:first-child {}

Safari
html[xmlns*=”"] body:last-child {}

Firefox 3
.classname, x:-moz-any-link, x:default {}
#id, x:-moz-any-link, x:default {}

====================

区别IE6与FF:
background:orange;*background:blue;

区别IE6与IE7:
background:green !important;background:blue;
区别IE7与FF:
background:orange; *background:green;

区别FF,IE7,IE6:
background:orange;*background:green !important;*background:blue;

区别FF 3
“{”前加上“, x:-moz-any-link, x:default”,只有FF 3能识别

注:
IE都能识别*;标准浏览器(如FF)不能识别*;
IE6能识别*,但不能识别 !important,
IE7能识别*,也能识别!important;
FF不能识别*,但能识别!important;

抱歉!评论已关闭.