Original article address
Differences between IE6, IE7, IE8, and Firefox
# Tip {
Background: Blue;/* the Firefox background turns blue */
Background: Red \ 9;/* The IE8 background turns red */
* Background: black;/* The IE7 background turns black */
_ Background: orange;/* change the IE6 background to orange */
}
Read "\ 9" for IE series browsers, while "*" for IE6 and IE7 (MI font size). In addition, IE6 can recognize "_" (bottom line), so it can be written in order, this will allow the browser to correctly read and understand CSS syntax, so it can effectively differentiate ie versions and non-ie browsers (such as Firefox, opera, Google Chrome, Safari, etc ).
Difference between IE6 and IE7 (method 2)
# Tip {
Background: Black! Important;/* The IE7 background turns black */
Background: orange;/* change the background of IE6 to orange */
}
Because IE7 can read 「! Important; "but IE6 does not work, and the CSS read step is from top to bottom. Therefore, IE6 cannot be recognized when reading 「! Important directly jumps to the next line to read CSS, so the background color is orange.
Another trick
<Style. type = "text/CSS">
# Example {color: red;}/* Firefox */
* Html # example {color: Blue;}/* IE6 */
* + Html # example {color: green;}/* IE7 */
</Style>
</Head>
<Body>
<Div id = "example"> Firefox should be red, ie6.0 should be blue, and ie7.0 should be green. </Div>
</Body>