This article uses the latest IE10 and firefox and chrome tests (as of 22:23:22, January 1, May 27, 2013)
CSS principles:
As we know, CSS writes in different places have different priorities. definitions in the. css file <attributes in the element style, but if they are used! Important, things will become different.
First, read the following code:
<! Doctype html>
Although the element style has the testClass class definition, it is used in the css definition above! Important defined the highest priority, whether in ie6-10 or Firefox and Chrome are consistent, show blue.
This also indicates that ie6 can be identified! Important, but this is a defect of ie6. Ie6 cannot recognize the following styles:
.testClass{ color:blue !important;color:red;}
In this way, the display in ie6 will be red.
Of course, you can also identify ie6 in the following ways:
. TestClass {
Color: blue! Important;
}
. TestClass {
Color: red;
}
The above method also enables ie6 to be displayed in blue.
The above example is used! The css definition of important has the highest priority. There is only a small bug in ie6. Note that writing methods can be easily avoided.