The main use of the browser is to distinguish the CSS hack, some people may already know the IE6 and IE7 methods, but today we add a way to distinguish IE8.
IE8 and IE8 the following versions
The key to distinguishing them is to add "9" after the style.
1.body {
2. color:red; * All browsers, of course * *
3. Color:green9; /* IE8 and below * *
4.}
Note that you must use "9", I tried to use "8", can not work, must be "9".
IE7 and IE7 the following versions
The key to distinguishing them is to add a "*" symbol to the front of the style, as follows:
1.body {
2. color:red; * All browsers, of course * *
3. Color:green9; /* IE8 and below * *
4. *color:yellow; /* IE7 and below * *
5.}
IE6
Many designers may already be familiar with the use of underscores in front of the style to distinguish IE6, which is no more than the "*" symbol, because it is only used to distinguish between IE6.
1.body {
2. color:red; * All browsers, of course * *
3. Color:green9; /* IE8 and below * *
4. *color:yellow; /* IE7 and below * *
5. _color:orange; * IE6 * *
6.}
Use CSS Hacks carefully
We do not advocate using CSS hacks on any occasion, but we recommend using conditional annotations. But understanding CSS hacks is not a bit useless, at least to show someone else ~ ~
Use CSS hacks, because it is not forward compatible, perhaps the latest browser does not buy the account, then your page will suffer. If you are using compatible IE6 only to change one or two attributes, it is advisable to use conditional annotations if the changes are large.