1. HTML page:
1 <!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd ">2 <HTMLxmlns= "http://www.w3.org/1999/xhtml">3 <Head>4 <title></title>5 <Scriptsrc= "Scripts/jquery-1.7.1.min.js"type= "Text/javascript"></Script>6 <!---If it's ie7-- -7 <!--[If IE 7]>8 <link href= "content/ie7.css" rel= "stylesheet" type= "Text/css"/>9 <! [EndIf] -Ten One <!---If it's ie8-- - A <!--[If IE 8]> - <link href= "content/ie8.css" rel= "stylesheet" type= "Text/css"/> - <! [EndIf] - the - <!--[If Lt IE 6]> IE6 and IE6 The following versions are recognized <! [EndIf] - - <!--[If GTE IE 6]> IE6 and IE6 above are recognized <! [EndIf] - - + <!---If not ie-- - - <!--[if! ie]><! - + <Linkrel= "stylesheet"type= "Text/css"href= "Content/gg.css" /> A <!--<! [EndIf] - at </Head> - <Body> - <Divclass= "Main"> - </Div> - <inputtype= "text" /> - </Body> in </HTML>
2. Style sheet:
(1) Ie7.css
1{2 }3. Main4 {5 width:200px; 6 height:100px; 7 background-color:Red; 8 }
(2) Ie8.css
1{2 }3. Main4 {5 width:200px; 6 height:100px; 7 background-color:Gray; 8 }
(3) Non-IE browser, other.css
1{2 }3. Main4 {5 width:200px; 6 height:100px; 7 background-color:Yellow; 8 }
3. Effect:
(1) IE7
(2) IE8
(3) Google Chrome
(finish!)
Determine the browser version load corresponding style sheet (file)