Im trying to use a conditional statement in IE to hopefully avoid hacking my CSS, well at least too much:
<!--[if IE]>
However, IE is not seeing the sheet. I use FireFox mainly but have Opera installed and use IE to make sure I have some cross browser compatability. I set a background color in the IE style sheet but it just isnt showing up. Im not sure what exactly Im doing wrong. Isnt the href relative to where the index file is? Or am I missing something?
I would certainly appreciate any help, its kinda frustrating. I hate to hack my CSS all up when the rest of the browsing world works as I normally intend it to.
It looks like its formed correctly. Have you tried just putting in some simple inline CSS inside the tags rather than try to import a sheet? At least you could try and rule out a few problems that way.
It looks like its formed correctly. Have you tried just putting in some simple inline CSS inside the tags rather than try to import a sheet? At least you could try and rule out a few problems that way.
You mean instead of linking to the style sheet, put a css rule inside the conditional statement?
<!--[if IE]>
p {
text-align: justify;
}
Like that?
Also, where is that statement supposed to go? I put it inside the head tags since thats where normal CSS style sheet links would go, but Ive read it should go elsewhere. I tried the suggestions but nothing has worked. Thanks in advance.
<!--[if IE]>
<style>
p {
text-align: justify;
}
</style>
<![endif]-->
Try like that.
Okay. I did it like that and it sees the code only when I put it within the body tag. Which is fine as it applies only to IE. However, it still doesnt see the stylesheet when I try to use the link option. That said, Im not sure what is wrong with the path as it sees the regular style sheet meant for all the browsers out there that at least have some compliance with the W3C standards.
The only thing I can think of at this point is that I am using Joomla content management. With in the head tag of the index file is a link to the standard css file using the following code:
" ; ?>
Is it possible that the call to the style sheet through php is overriding the call to the conditional comment stylesheet? If so how can I get it to work through the php code without loosing the main stylesheet for all the other browsers?
Possible fix: hyphen may not be allowed in filename, so rename your css file to "ie.css" or something that doesn't use (possibly) illegal characters. Href is relative to the file in which the href appears.
I also seem to remember something about Opera wanting embedded <style> specs to go within the
Code:
<body></body>
tags, NOT in the head. All the more reason to use an external stylesheet. But silmaril8n's suggestion is a good one for testing!
Don't give up. IE's noncompliance with web standards is enough to make the most patient person a little crazy!
Last edited by wvperegrine on Wed May 17, 2006 10:34 am; edited 1 time in total
Possible fix: hyphen may not be allowed in filename, so rename your css file to "ie.css" or something that doesn't use (possibly) illegal characters. Href is relative to the file in which the href appears.
I also seem to remember something about Opera wanting embedded