method One:
<!--[If LTE IE 6]> <link rel= "stylesheet" type= "Text/css" href= "Images/style_ie5.css"/> <! [endif]–> <!--[if IE 6]> <link rel= "stylesheet" type= "Text/css" href= "Images/style_ie6.css"/> <! [endif]--> <!--[if IE 7]> <link rel= "stylesheet" type= "Text/css" href= "Images/style_ie7.css"/> <! [endif]-->
Applicable browser: IE5 above the IE browser
Using Technology: Conditional comments
Where to use: in HTML code (note not in CSS)
Comparison character:
LTE: Is the shorthand for less than or equal to, meaning less than or equal to.
LT: It is the shorthand for less than, which means less than.
GTE: is the shorthand for greater than or equal to, which is greater than or equal to the meaning.
GT: is the shorthand for greater than, which means greater than.
! : Is not equal to the meaning, and JavaScript is not equal to the same judge character
Method Two:
#example {color:red;} /*firefox*/* HTML #example {Color:blue} /*ie6*/*+html #example {color:green;} /*ie7*/
Place of Use: CSS
Method Three:
<link type= "Text/css" rel= "stylesheet" href= "Css/screen.css"/> <link type= "text/css" rel= "stylesheet" href= " Css/screen.css "/> <script language=" JavaScript type= "Text/javascript" > <!--//depending on the browser to select CSS if (!window. XMLHttpRequest) {setactivestylesheet ("ie6.css");//ie6}else if (window. ActiveXObject) {setactivestylesheet ("ie7.css");//ie7} else {setactivestylesheet ("firefox.css");//mozilla FireFox, Safari, etc.} function Setactivestylesheet (filename) {var path = document.getElementsByTagName ("link") [1].href; document.getElementsByTagName ("link") [1].href= "css/" +filename; }//--> <script>
This is the use of different versions of the browser to create XMLHttpRequest different ways to choose different CSS