CSS & IE not picking up the IE stylesheet

Hi

I have got a oscommerce website and am having great difficulty getting IE to pick up the external IE CSS stylesheet

Not sure where I am going wrong

The coding linking the stylesheet is below

<!--[if IE]>
<link rel="stylesheet"type="text/css" href="allieonly.css" />
<!--[endif]/-->

The css stylesheet starts with the following

<style> and ends with </style>

Where am I going wrong with it

Kind regards

Ian

Hi,

There are three problems with your code above.

Firstly your closing conditional comments are malformed and they should be like this:



<![endif]-->

Secondly the css stylesheet should not contain style tags. The stylesheet can contain only css and css comments. Style tags are html not CSS.

Thirdly, it is highly unlikely that you want to target all IE as IE8+ are pretty good and need few hacks. You should send the hacks to ie7 and below only.

e.g.


<!--[if lte IE 7]>
<link href="iecss.css" rel="stylesheet" type="text/css" />
<![endif]-->

If you need ot target IE8 or IE9 then do it specifically.


<!--[if  IE 9]>
<link href="ie9ss.css" rel="stylesheet" type="text/css" />
<![endif]-->
<!--[if  IE 8]>
<link href="ie8ss.css" rel="stylesheet" type="text/css" />
<![endif]-->

However, in most layouts you will seldom need to target IE9 and in most cases you could live with the differences anyway.