tags:

views:

109

answers:

7

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.

+1  A: 

Change:

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

To:

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

to use IE-based CSS.

Sarfraz
Not correct: you're still using [downlevel-revealed conditional comments](http://msdn.microsoft.com/en-us/library/ms537512%28VS.85%29.aspx#dlrevealed), 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.
Marcel Korpel
+5  A: 

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.

deceze
well eventhough i used this code its simply not working.
Jay
@Jay Update your question with more of the code you used, because this is supposed to work.
deceze
+1  A: 

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]>
Ju9OR
this really works.thanks guys..
Jay
+1  A: 

Try

<!--[if lte IE 6]><link href="ie6.css" rel="stylesheet"><![endif]-->
Ms2ger
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.
Marcel Korpel
Good point indeed.
Ms2ger
+1  A: 

I'm using this;

<!--[if IE 6]>
this place for your stuff.
<![endif]--> 
Aaron
+2  A: 

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.

Ryano
yes it's working..thanks
Jay
A: 

If you're going for IE 6 specific CSS, I would do:

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

Here's some more information on conditionals: http://msdn.microsoft.com/en-us/library/ms537512%28VS.85%29.aspx

Hristo