The simplest way to solve browser compatibility problems encountered in CSS is CSS Hack. Now we will talk about how to write CSS Hack in different browsers!
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 between 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,
IE7 can recognize * , can also recognize !important;
FF cannot recognize *, but can recognize !important;
IE6 IE7 FF
* √ √ ×
!important × √
√Another addition, underline "_",
IE6 supports underline, but neither IE7 nor firefox supports it. Underline.
So you can also distinguish IE6, IE7, and firefox like this
: background:orange;*background:green;_background:blue;
Note: No matter what method is used, the order of writing is that firefox is written in the front, and IE7 is written in the middle. IE6 is written at the end.