Jay
Jay

Reputation: 775

IE cross browser compatibility problem

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.

Upvotes: 2

Views: 594

Answers (6)

Ryano
Ryano

Reputation: 2120

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.

Upvotes: 3

Aaron
Aaron

Reputation: 225

I'm using this;

<!--[if IE 6]>
this place for your stuff.
<![endif]--> 

Upvotes: 2

Ms2ger
Ms2ger

Reputation: 15983

Try

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

Upvotes: 2

Tor-Erik
Tor-Erik

Reputation: 1000

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]>

Upvotes: 1

deceze
deceze

Reputation: 522081

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.

Upvotes: 6

Sarfraz
Sarfraz

Reputation: 382696

Change:

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

To:

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

to use IE-based CSS.

Upvotes: 1

Related Questions