The difference between different browsers and CSS hack is that there are manyArticleIn this section, we will try to make it as comprehensive as possible for future reference.
Note that the hack statements described below only apply to xhtml1.0. If <! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <HTML xmlns = "http://www.w3.org/1999/xhtml">
The effect will be different! In addition, the IE8 mentioned here does not refer to the IE8 compatibility mode, because the IE8 compatibility mode is actually IE7.
Difference between IE6, 7, and FF/IE8:
Background: Blue; * Background: orange;
Reference display effect:
Internet Explorer 6/7: Orange
FF/IE8: Blue
Principle: FF/IE8 does not support *, whereas IE6/7 does.
Difference between IE6 and IE7/IE8/FF:
Background: green; _ Background: blue;
Reference display effect:
IE7/8/FF: Green
IE6: Blue
Principle: IE6 supports underlines "_", and IE7, 8, and Firefox do not support underscores.
Difference FF/IE8 and IE6/7:
Background: orange; + Background: green;-Background: blue;
Or
Background: orange; * Background: Green! Important; * Background: blue;
Reference display effect:
IE6: Blue
IE7: Green
FF/IE8: Orange
Principle: IE6 can recognize-, IE7 can recognize +, IE8 and FF cannot recognize + and-
IE8/FF are not recognized *, and IE7 is preferred! Important and IE6 cannot be recognized! Important.
Hacks about IE8:
. Test {
Color:/* \ **/# 00f \ 9;/* IE8 only */
Color: # 00f \ 9;/* Applicable to All ie versions */
}
CSS hacks of IE8, IE7, IE6, and Firefox can be distinguished simultaneously:
. Test {
Color: #000;/* Firefox */
Color:/* \ **/# 00f \ 9;/* IE8 */
* Color: # f00;/* IE7 */
_ Color: #0f0;/* IE6 */
}
IE6 supports (_) _ color: red;
IE7 supports (+) + color: blue;
IE8 supports (/* \ **/... \ 9)/* \ **/color: Black \ 9;
IE6 supported _ IE7 IE8 not supported _
_ Color: red; color: blue;
IE6 IE7 * not supported by IE8 *
* Color: red; color: blue;