Method 1:
<Script language = "JavaScript">
Function getie ()
{
If (navigator. appname = "Microsoft Internet Explorer ")
{
If (navigator. appversion. Match (/7./I) = '7 .')
{
// IE7, no jump
}
Else
{
// No, jump
Location. href = 'HTTP: // 127.0.0.1 ';
}
}
}
</SCRIPT>
Method 2:
<Span id = "CSS"> </span>
<SCRIPT>
If (navigator. useragent. indexof ("MSIE")> 0)
{
// Whether the browser is Internet Explorer
If (navigator. useragent. indexof ("MSIE 6.0")> 0)
{
// 6.0 use 1.css
CSS. innerhtml = '<link href = "1.css" rel =" stylesheet "type =" text/CSS ">'
}
If (navigator. useragent. indexof ("MSIE 7.0")> 0)
{
// 7.0 use 2.css
CSS. innerhtml = '<link href = "2.css" rel =" stylesheet "type =" text/CSS ">'
}
} Else
{
// Otherwise, you can use 3.css and a specific browser. You can use navigator. useragent to obtain information.
CSS. innerhtml = '<link href = "3.css" rel =" stylesheet "type =" text/CSS ">'
}
</SCRIPT>
Method 3:
<HTML>
<Head>
<Link href = "1.css" rel =" stylesheet "type =" text/CSS "id =" mycss ">
</Head>
<Body>
<SCRIPT type = "text/JavaScript">
Function changecss ()
{
Document. getelementbyid ("mycss"). href = "2.css ";
}
</SCRIPT>
<Div id = "ts"> test </div>
<Input type = "button" onclick = "changecss ()" value = "change">
</Body>
</Html>