<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
.test {
background-color: red;
background-color:green!important;
}
.other {
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<div class="test other">test</div>
</body>
</html>
以前用!important只是Firefox可以識別的,後來試過IE7可以識別,現在好像所有的瀏覽器都識別了,這是怎麼回事啊?
我分別在IE6\7\8\9,Firefox,Chrome,Opera,Safari中測試過了,背景都顯示爲綠色,org.springframework.beans.factory.BeanInitializationException。
PS:之前在另一家公司做過CSS Hack工作。後來換公司就沒有玩CSS了,javax.microedition.rms.InvalidRecordIDException。前幾天總結CSS Hack經驗時突然發現上面的情況。雖然我不怎麼使用!important來Hack CSS,但是我不明白,明明以前IE6不支持它的,現在怎麼就支持它了,難道IE6還在升級??
糾結啊~
問題補充
好的~改過了,確實像上面兄弟說的那樣,現在IE6及其以下版本是紅色了~其它的都是綠色!
問題補充
OK,確實是這樣子,謝謝兄弟~
------解決方案--------------------------------------------------------
呵哥們看來你是好久沒做過了,你把這兩句換下位置就OK了
background-color:green!important;
background-color: red;
------解決方案--------------------------------------------------------
學習了……
------解決方案--------------------------------------------------------
可參考:
!important 使用的有關問題 http://www.myexception.cn/HTML-CSS/218331.html
相關的主題文章: