CSS hack

来源:互联网 发布:图像识别算法原理 编辑:程序博客网 时间:2024/06/05 00:21

 

什么是hack就是浏览器对不同写法的识别。

 

 

IE6识别*和_, 不识别 !important IE7识别*, 不识别_,识别 !important 而firefox两个都不识别, 识别 !important

做网站时经常会用到,衡量一个DIV+CSS架构师的水平时,这个也很重要。

区别不同浏览器的CSS hack写法:

区别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;

注:IE都能识别*;标准浏览器(如FF)不能识别*;

IE6能识别*,但不能识别 !important, IE7能识别*,也能识别!important; FF不能识别*,但能识别!important; 另外再补充一个,下划线"_", IE6支持下划线,IE7和firefox均不支持下划线。

0 0