Home > Article > Web Front-end > How to determine each version of IE browser in HTML and CSS
1. In HTML code
When writing web page code, the compatibility of various browsers is an issue that must be considered. Sometimes it is impossible to find a writing method suitable for all browsers, so you can only write according to the browsing The code that differentiates the type of device is the judgment code that needs to be used at this time. In the
HTML code, the code to distinguish various browsers is as follows, taking ie6 as an example
##
.classname{
blue; / *The background of non-IE browsers such as Firefox turns blue*/red \9; /*The background of IE8 turns red*/
*black; /*The background of IE7 turns black*/
}
.classname {
black !important; /*Non-IE6 background turns black*/
background:orange; /*IE6 The background turns orange*/
}
The above is the detailed content of How to determine each version of IE browser in HTML and CSS. For more information, please follow other related articles on the PHP Chinese website!