Web Hosting Talk







View Full Version : CSS / XHTML question


dhui
07-17-2008, 10:11 PM
Ok, so I am trying to diffrentiate style sheets for my site. I am trying to make it so that if the browser used is IE, then it uses a diff sheet, because everything shifts just a bit between mozilla and IE.

here is what I put in my HTML file.

<link href="CSS/styles.css" type="text/css" rel="stylesheet" />
<!--if[IE]>
<link href="CSS/IEstyles.css" type="text/css" rel="stylesheet" />
<![endif]-->

But it doesn't seem to run the "IEstyles.css" even when I view it in IE. Any solutions or pointers?

thanks guys!

Syd_M
07-17-2008, 10:32 PM
Use it like this:


<!--[if IE]>
<link href="CSS/IEstyles.css" type="text/css" rel="stylesheet" />
<![endif]-->

TRIBOLIS
07-22-2008, 03:50 AM
and make sure it's inside <head></head>

the_pm
07-22-2008, 07:02 AM
and make sure it's inside <head></head>Just a quick clarification - style information belongs in the <head> section of your site. But it's worth mentioning that IE conditional statements will function anywhere in an HTML document. You could use a statement like this to call up HTML code only for IE within the <body> section too. Just an FYI. For the purposes of your question, keep your markup in the <head> :)

BristolSue
07-23-2008, 03:44 PM
I've found this the best way to get it to work:
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://domain.com/css/iestyle.css" type="text/css" media="screen">
<![endif]-->
<link rel="stylesheet" href="http://domain.com/css/style.css" type="text/css" media="screen">

And of course, it goes in the head tags.