1. IE Hacks:
"_" is the exclusive hack of IE6; "\9" is effective for Ie6-ie10, "Ie9-ie10" is effective for ie8-ie10, and "\9\0" is effective for both;
Advantages:
CSS hacks embedded in the normal CSS, will not produce more HTTP requests. CSS hacks embedded in the normal CSS, it is more convenient to write.
Disadvantages:
It is a non-standard product. Embedded in other CSS, inconvenient to maintain. Especially when the number of hacks is more than the time to maintain is simply a nightmare. Embedded in other CSS, even in non-IE browser will be loaded, wasting resources.
2. Conditional comment CSS:
<!--[if IE 6]> < link rel= "stylesheet" type= "Text/css" media= "All" href= "./ie6.css"/><! [endif]-->
<! [endif]-->
Conditional annotations are an miscrosoft extension of IE proprietary to regular (X) HTML annotations. It is also a non-standard product from the standard, but it is Microsoft's official launch of the way for IE to develop,
And the conditional comment appears as a regular comment for all other browsers, so it is harmless to other browsers
Advantages:
The advantage of conditional comment CSS is that it is written in a standalone CSS file, which can control the load in specific IE without wasting resources and is easy to maintain.
Disadvantages:
is to generate extra HTTP requests, especially when you need a compatible version of IE a lot of time, you need to generate multiple HTTP requests, which would have been less than the number of low-version IE will undoubtedly affect the page loading speed.
The above two methods are not very good, the following methods are relatively good points;
3. Conditional Comment HTML tags:
This scheme also uses conditional annotations, but does not use conditional annotations on CSS, but instead uses conditional annotations on HTML tags, introducing different classes to differentiate between IE and other browsers;
<!DOCTYPE HTML> <!--[If IE 6]> - <!--[If LTE IE 6]> - <!--[If LTE IE 7]> - <!--[If LTE IE 8]> - <!--[If (GTE IE 9) |! (IE)] ><! -<HTMLLang= "ZH-CN"><!--<! [EndIf] -
Then add the corresponding class to the CSS of the specific IE and write it in the normal CSS file:. IE6. header. Nav {margin:0 0 0;p adding:0 0 0 0; }
Advantages:
The advantage of conditional comment expressions is that they do not produce extra HTTP requests;
Disadvantages:
Since these CSS for specific IE and the normal CSS put together, that is not the corresponding IE will be loaded, so if the number of CSS more than the words will be like using hacks, resulting in waste;
The above method: need to choose the method according to the specific situation.
CSS style (compatibility) for IE browser