CSS hack:区分IE6,IE7,firefox

2008-03-31 (9:46 上午)

作者:驽鸟

分类:电脑网络

标签:CSS, CSS hack

区别不同浏览器,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的写在最后面。

 

上一篇:狄仁杰介绍
下一篇:CSS14个实用技巧的精选推荐

管理日志

  1. 首页
  2. 登录