CSS hack:区分IE6,IE7,firefox

发布时间: 2008-03-31 09:46 | 作者: 驽鸟

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

区别FF与:IE6

       background:orange;*background:blue;

 

区别IE7IE6

       background:green !important;background:blue;

 

区别FFIE7

       background:orange*background:green;

 

区别FFIE7IE6

       background:orange;*background:green !important;*background:blue;

 

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

IE6能识别*,但不能识别 !important,

IE7能识别*,也能识别!important;

FF不能识别*,但能识别!important;

 

另外再补充一个,下划线"_",

IE6支持下划线,IE7firefox均不支持下划线。

 

于是大家还可以这样来区分FirefoxIE7IE6:

       background:orange;*background:green;_background:blue;

 

 

Firefox

IE7

IE6

*

×

_

×

×

!important

×

 

注:不管是什么方法,书写的顺序都是Firefox的写在前面,IE7的写在中间,IE6的写在最后面。

 

关键字: , | 分类: 电脑网络 | 评论数: | 阅读全文
喜欢 驽鸟公寓 的文章,那就通过 RSS Feed 功能订阅阅读吧!

已经有3 个评论

  1. yacca 说:

    :em08: 看你的相关日志…怎么觉得就怪怪的…呢
    **********
    怪吗?默认滴!我没改过!

  2. Booto 说:

    :em27: 过时了
    **********
    怎么过时了?

  3. 在职研究生 说:

    算鸟,转给我们公司美工看
    **********
    不错吧!

我要评论

*

* 绝不会泄露