This article uses the latest IE10 and Firefox and Chrome tests (as of May 27, 2013 22: at: Athe principle of CSS: We know that CSS write in different places have different priorities,. css file DefinitionsThe < element style property, but if used!important, things will become different. First, let's look at the following code:<! DOCTYPE Html>"Content-type"Content="text/html; Charset=utf-8"><title> Test in CSS! Important difference </title> "Text/css">. testclass{Color:blue!important;}</style><body> <divclass="TestClass"style="color:red;">testing the important in CSS</div></body>Although the style of the element has the definition of the TestClass class, it is used in the CSS definition aboveThe!important definition is the highest priority, whether in ie6-10 or Firefox and Chrome are all consistent and show blue. This also shows that IE6 can be identified!important, but this is a flaw of 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. The above example illustrates the use ofThe CSS definition of!important is the highest priority. Just in the IE6 out a little bit of bug, note that the writing method is generally easy to avoid.
The use of!important in CSS