Welcome to WebmasterWorld Guest from 54.147.212.173

Forum Moderators: incrediBILL

Message Too Old, No Replies

IE conditional comments not working?

Conditional comments for IE 5/5.5 not working.

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

Junior Member

10+ Year Member

joined:Sept 29, 2006
posts:55
votes: 0


Hi,

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.

MARKUP:

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

Please help if you can

Regards

Erdy

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

Full Member

10+ Year Member

joined:Oct 9, 2002
posts:245
votes: 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)

Junior Member

10+ Year Member

joined:Sept 29, 2006
posts:55
votes: 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)

Preferred Member

10+ Year Member

joined:Aug 17, 2005
posts:432
votes: 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)

Senior Member from US 

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 17, 2005
posts:4993
votes: 14


@erdy
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)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Mar 29, 2007
posts:1147
votes: 0


Here's the MSDN page for the comments:
[msdn2.microsoft.com...]

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.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members