Choosing CSS depending on browser
-
Hi people,
I want my header.php to use one CSS if viewed in IE and another if viewed with any other browser.
I’m doing:
<script type="text/javascript"> if (navigator.userAgent.indexOf("msie")!=-1){ document.write('<'+'link type="text/css" media="screen" rel="stylesheet" href="<?php bloginfo("template_url"); ?>/ie.css" />') }else{ document.write('<'+'style type="text/css" media="screen"><!-- @import url( <?php bloginfo("stylesheet_url"); ?> ); --></style/>') } </script>
But it does not show any CSS at all. What am I doing wrong??
The javascript is working fine out of WordPress ..Thanks in advance!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Choosing CSS depending on browser’ is closed to new replies.