2

i have a problem in using IE. Everthing is good in using firefox but IE 6 seems to be creating more trouble for css. so i used

<![if !IE]>
<link href="ie6.css" rel="stylesheet">
<![endif]>

To fix a problem but it doesnot work. Anything wrong in this code? Because when i altered this css nothing has changed in IE.

asked Jul 7, 2010 at 9:20

6 Answers 6

6

Well, your conditional comment says "if not IE".
Also note that you're using a downlevel-revealed conditional comment, which means every browser (except IE) will include the extra CSS file.

Use <!--[if IE]><![endif]--> instead.

answered Jul 7, 2010 at 9:25
Sign up to request clarification or add additional context in comments.

1 Comment

@Jay Update your question with more of the code you used, because this is supposed to work.
3

Try using this condition statement:

<!--[if lt IE 7]>
 <link href="ie6.css" rel="stylesheet">
<![endif]-->

Basically its saying if the browser is less than IE7 then use this style sheet. Works for me.

answered Jul 7, 2010 at 13:12

Comments

2

Try

<!--[if lte IE 6]><link href="ie6.css" rel="stylesheet"><![endif]-->
answered Jul 7, 2010 at 11:51

1 Comment

Though your answer is technically correct, I wouldn't test for lte IE 6; IE <= 5.5 has many other quirks to deal with, as IE 6 Standards Mode differs very much from IE 5.5's rendering engine, also known as Quirks Mode in IE >= 6.
2

I'm using this;

<!--[if IE 6]>
this place for your stuff.
<![endif]--> 
answered Jul 7, 2010 at 11:54

Comments

1

Change:

<![if !IE]> ! means not IE there

To:

<![if IE]> means if it is IE

to use IE-based CSS.

answered Jul 7, 2010 at 9:24

1 Comment

Not correct: you're still using downlevel-revealed conditional comments, like the OP did; every other browser than IE won't recognize these things as valid HTML and will simply ignore them, so everything inside will not be ignored.
1

Is the ie.css placed after any other css files? If you have placed it before your regular css it will be overridden. It should look something like this:

 <link href="other.css" rel="stylesheet">
 <![if IE]>
 <link href="ie6.css" rel="stylesheet">
 <![endif]>
answered Jul 7, 2010 at 9:52

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.