I. CSS HACK
The following two methods can solve almost all today's HACK.
1 ,! Important
With IE7! Important support ,! The important method is only for the HACK of IE6. (note the writing method. Remember to advance the declaration position .)
<Style>
# Wrapper
{
Width: 100px! Important;/* IE7 + FF */
Width: 80px;/* IE6 */
}
</Style>
2, IE6/IE77 for FireFox
* + Html and * html are unique tags of IE, which are not supported by firefox at the moment. * + html is also a unique tag of IE7.
<Style>
# Wrapper
{
# Wrapper {width: 120px;}/* FireFox */
* Html # wrapper {width: 80px;}/* ie6 fixed */
* + Html # wrapper {width: 60px;}/* ie7 fixed, pay attention to the order */
}
</Style>
] CSS hack: differentiate IE6, IE7, and firefox
Difference between different browsers, CSS hack writing:
Difference between IE6 and FF: background: orange; * background: blue;
Difference between IE6 and IE7: background: green! Important; background: blue;
Difference between IE7 and FF: background: orange; * background: green;
Difference FF, IE7, IE6: background: orange; * background: green! Important; * background: blue;
Note: IE can recognize *; standard browsers (such as FF) cannot recognize *; IE6 can recognize *, but not! Important and IE7 can recognize * and also! Important; FF cannot recognize *, but can recognize it! Important;
IE6 IE7 FF
* & Radic; ×
! Important × & radic;