根據(jù)不同的瀏覽器調(diào)用不同的CSS設(shè)置

字號:


    <!-- 完整的HTML代碼如下: -->
    <html>
    <head>
    <title>根據(jù)瀏覽器用CSS</title>
    <style type="text/css">
    <!--
    body { font-family: "宋體"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px}
    A { COLOR: black; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none }
    A:hover { COLOR: red; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: underline }
    a:active { font: 9pt "宋體"; cursor: hand; color: #FF0033 }
    -->
    </style>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    <body bgcolor="#fef4d9">
    <center>
    <font color=red face="隸書" size=6>根據(jù)瀏覽器用CSS<font size="5"></font></font>
    </center>
    <br>
    <center>
    <table border=5 bordercolor=blue borderlight=green>
    <tr>
    <td width=450 height=194>
    <p><b><font color="#3333FF">代碼如下:<br>
    </font></b>
    <head>
    <script language=javascript> <br>
    <!--<br>
    if ((navigator.appName == "Microsoft Internet Explorer") &&
    (parseInt(navigator.appVersion) >= 4))<br>
    {<br>
    document.write('<link rel=stylesheet type="text/css" href="<font color="#FF0033">ie.css</font>">')<br>
    }<br>
    else {document.write('<link rel=stylesheet type="text/css"
    href="<font color="#FF3333">ns.css</font>">')}<br>
    //--><br>
    </script><br>
    </head> </p>
    <p></p>
    <br>
    </td>
    </tr>
    </table></center>
    <center>
    </center>
    <br>
    <br>
    </body>
    </html>