This article uses the latest IE10 and Firefox and Chrome tests (as of May 27, 2013 22:23:22)
The principle of CSS:
We know that CSS is written in different places with different priorities,. css file definitions < elements in the style, but if you use!important, things will get a difference.
First, let's look at the following code:
<! DOCTYPE html>
Although the style of the element has the definition of the TestClass class, the!important-qualified definition in the above CSS definition is the highest priority, both in the ie6-10 or in Firefox and Chrome, both of which are displayed in blue.
This situation can also indicate that IE6 can identify!important, but this is a flaw in IE6. If written in the following style, IE6 is not recognized:
. testclass{Color:blue!important;color:red;}
In this way, it appears red when displayed under IE6.
Of course, IE6 can also be identified by the following methods:
. testclass{ color:blue!important; } . testclass{ color:red; }
It is also possible to make the IE6 appear blue by the above method.