View Full Version : browser specific css

Apr 9th, 2007, 09:55 PM
I know the browser detection is woorking but what am i doing wrong when calling my css file?
<script type="text/javascript">
css = new array()
var browserName=navigator.appName;
if (browserName=="Microsoft Internet Explorer")
{css = "StyleIE.css";}
else if (browserName=="Netscape")
{css = "StyleNS.css";}
else if (browserName=="Opera")
{css = "StyleO.css";}
function css{document.getElementById("css").href = css;}
<link href="Style.css" rel="stylesheet" type="text/css" id="css"/>

Apr 9th, 2007, 10:51 PM
You named your array css, and your function css? I don't know if this is causing your problem, but your code could be a lot less confusing if you named variables and functions better. (and your <link> tag id is css too? Dang)