div {
background-color:red\0; /* IE 8/9*/
background-color:blue\9\0; /* IE 9*/
*background-color:green; /* IE 7*/
_background-color:gray; /* IE 6*/
}
Note the order in which the Csshack is written:
1.BACKGROUND-COLOR:RED\0;IE8 and IE9 are all supported;
2.background-color:blue\9\0; only IE9 support;
(1) Distinction FF (IE8) and IE6 IE7
Backgorund:orange; FF and IE8 background colors will be orange
*backgorund:red; IE6 and IE7 background colors will be red
(2) Distinguishing FF (IE8) with IE6 and IE7
Background:orange; FF and IE8 background colors will be orange
*background:red!important; IE7 background color will be red
*background:blue; IE6 background color will be blue
(3) Distinguishing FF (IE8) with IE6 and IE7
Background:orange; FF and IE8 background colors will be orange
*background:red; IE7 background color will be red
_background:blue; IE6 background color will be blue
(4) Distinguishing ff from IE6 IE7 IE8 IE9
Color:gray; FF and other non-IE browser font color will be gray
color:red\9; IE8 IE9 font color will be red
*color:green; IE7 font color will be green
_color:blue; IE6 font color will be blue
Hint: CSS hack writing order: first write FF and other non-IE browser required style, followed by the IE8/9 required style, followed by the IE7, and then IE6!
Summary: In practical use I feel less used to!important, as long as you remember "*" and "_" I think it is enough to distinguish between FF (IE8) and IE6 and IE7.
This article links http://www.cxybl.com/html/wyzz/CSS/20130622/38769.html