different browsers, CSS hack, from the internet to see a lot of articles, now summed up, as far as possible, for future reference.
Note that the hack written below are applicable only to XHTML1.0. If the HTML is not preceded by the
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
, the effect will be different! In addition, the IE8 described here does not refer to the IE8 compatibility mode, because the IE8 compatibility mode is actually IE7.
Difference IE6, 7 and FF/IE8:
background:blue;*background:orange;
References
Display effect:
IE 6/7:orange
Ff/ie8:blue
Principle: FF/IE8 does not support the start of * and IE6/7 is supported.
Difference IE6 and ie7/ie8/ff:
background:green;_background:blue;
References
Display effect:
Ie7/8/ff:green
Ie6:blue
Principle: IE6 supports underscore "_", IE7, 8, and Firefox do not support underscores.
distinguishes Ff/ie8 and IE6/7:
Background:orange;+background:green;-background:blue;
or
Background:o Range;*background:green!important;*background:blue;
References
Display effect:
Ie6:blue
Ie7:green
Ff/ie8:orange
Principle: IE6 can recognize-,ie7 and FF are not recognized + and +,IE8> IE8/FF do not recognize *,IE7 priority recognition!important,ie6 cannot recognize!important.
About IE8 hacks:
. test{
color: #00f9;
color:# 00F9;
}
can distinguish between IE8, IE7, IE6, Firefox css hacks:
. test{
color: #000;
color: #00f9;
*color: #f00;
_color: #0f0;
}