IE6与!important

之前一直以为IE6是不能识别!important的,今晚发现这个想法是错误的。

IE6是在某种情况下不能识别!important,但某种情况下又能。

比如,在样式表里面这样写

{

  color:red !important;

  color:blue;

}

这样在IE6下是无效的,结果会是blue;

但是如果在样式表里写

{

  color:red!important;

}

然后在其他地方,总之不要在同个{}里面出现的话,那么!important起到了他的作用了,优先级最高。

所以,IE6并不是不能识别!important,而是他识别的点有点怪异。

posted on 2012-11-04 23:25  zhrj000  阅读(405)  评论(0编辑  收藏  举报