关心IE6中!important的问题

关心IE6中!important的问题,我们知道!important是优先级是最高的,在IE6中使用!important,有时候有用,有时间没用,这是IE6的一个Bug,网上很多资料说IE6不支持important,其实是这一种误解,本人经过测试,IE的确支持!important,看看下面的代码:

 

.box{width:100px; height:100px; background:red!important; background:green;}
 

 

<div style="width: 100px; height: 100px; background: red; color: white; margin: auto;">FF,OP,SA,IE7 8 9 10</div>
 


<div style="width: 100px; height: 100px; background: green; color: white; margin: auto;">IE6</div>
 


<p>本来这段代码应该显示红色,但是在IE6下显示绿色,

NOW,再看下面的代码:

 

.box{width:100px; height:100px; background:green; background:red!important;}
<div style="width: 100px; height: 100px; background: red; color: white; margin: auto;">FF,OP,SA,IE6 7 8 9 10</div>
 



OK,亲,你会发现显示是红色的。明白了吧,呵呵。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值