I have a site that looks fine in Safari and IE6 but suffers from a 1-pixel misalingment in Firefox and Camino. To fix this, I want the page to use a different CSS file if it's Firefox or Camino. I don't know JavaScript myself, though I've done programming in other languages. I got most of this from a book I have, but right now Firefox doesn't load any CSS file at all.
I have this script before my closing </head> tag:
I have this script before my closing </head> tag:
Code:
<script type="text/javascript">
var isKHTML = sUserAgent.indexOf("KHTML") > -1
|| sUserAgent.indexOf("Konqueror") > -1
|| sUserAgent.indexOf("AppleWebKit") > -1;'
var isMoz = sUserAgent.indexOf("Gecko") > -1
&& !isKHTML;
if(isMoz)
document.writeIn(<link href="home.css" rel="stylesheet" type="text/css" />);
else
document.writeIn(<link href="homecopy.css" rel="stylesheet" type="text/css" />);
</script>







