关于css important的问题#hehe{color :#000 important; }#hehe{ \x05\x05color :#f00;}呵呵呵呵我这样写的时候,文字在所有浏览器中都是黑色#hehe{}#hehe{ color :#000 important; \x05\x05color :#f00;}呵呵呵呵这样写的时候,FF

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/15 19:27:45

关于css important的问题#hehe{color :#000 important; }#hehe{ \x05\x05color :#f00;}呵呵呵呵我这样写的时候,文字在所有浏览器中都是黑色#hehe{}#hehe{ color :#000 important; \x05\x05color :#f00;}呵呵呵呵这样写的时候,FF
关于css important的问题
#hehe{
color :#000 important;
}
#hehe{
\x05\x05color :#f00;
}

呵呵呵呵

我这样写的时候,文字在所有浏览器中都是黑色
#hehe{
}
#hehe{
color :#000 important;
\x05\x05color :#f00;
}
呵呵呵呵

这样写的时候,FF和谷歌是黑色,但是IE678是红色
我用的是IETESTER,也有可能不准确,但电脑上的IE是IE8,也是红色
不是说只有IE6不识别!important吗?为啥7和8也是红色?

关于css important的问题#hehe{color :#000 important; }#hehe{ \x05\x05color :#f00;}呵呵呵呵我这样写的时候,文字在所有浏览器中都是黑色#hehe{}#hehe{ color :#000 important; \x05\x05color :#f00;}呵呵呵呵这样写的时候,FF
IE支持重定义中的!important,例如:
  .yuanxin {color:#e00!important;}
  .yuanxin {color:#000;}
  你将会发现定义了样式class="yuanxin"时,在IE下,字体显示为红色(#e00).
(包括IE6 7 8)
  但不支持同一定义中的!important.例如:
  .yuanxin {color:#e00!important;color:#000}
  此时在IE6下不支持,你将会发现定义了样式class="yuanxin"时,字体显示为黑色(#000).
  ie6中:
  /*样式1*/
  #a{width:100px !important} /*有效*/
  #a{width:50px} /*无效*/
  /*样式2*/
  #a{width:100px !important; width:50px;} /*width:100px无效,width:50px 有效*/