homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

IE conditional comments not working?
Conditional comments for IE 5/5.5 not working.

 7:47 pm on Oct 21, 2007 (gmt 0)


I am trying to create a separate CSS file for IE5 & IE5.5
I have tried to use IE conditional comments with the mark up below but it isn't working. Is this mark up incorrect?
I have taken it from a well respected book so I baffled why it doesn't work.


<!--[if lt IE 6]>
<STYLE TYPE="text/css">
P {color:blue}
@import ("ie5.css");

Please help if you can





 7:53 pm on Oct 21, 2007 (gmt 0)

Leave out the "It" so that it's <!--[if IE 6]> and it should work for you.


 10:44 pm on Oct 21, 2007 (gmt 0)

Hi Edouard_H,

I want to exclude IE6 and only apply rules to IE 5 & 5.5
So surely I don't want to do what you suggest?

The lt is 'less than' isn't it?


 10:59 pm on Oct 21, 2007 (gmt 0)

Have a look at this thread its in the CSS libray
MS conditional comments [webmasterworld.com]


 6:31 pm on Oct 22, 2007 (gmt 0)

Looks correct to me. Be aware that this only applies to IE/Win (not IE on the Mac). Also, could it be that you have other styles that are overriding your IE5 styles? For example, if your IE5 styles are included BEFORE your other styles, or if your IE5 styles have a lower specificity.


 9:56 pm on Oct 22, 2007 (gmt 0)

Here's the MSDN page for the comments:

It appears you have the syntax correct, I'd have to say same as previous, it may be a CSS conflict.

Try sticking something very obvious but unique in your ie5.css, like:
BODY { border: 10px solid red; }

That shouldn't be defined anywhere else but will certainly stand out if the CSS has been included.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved