SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Apr 2009
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

    Code:
    <!--[if IE]>
    <link rel="stylesheet"type="text/css" href="allieonly.css" />
    <!--[endif]/-->
    The css stylesheet starts with the following

    Code:
    <style> and ends with </style>
    Where am I going wrong with it

    Kind regards

    Ian

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,389
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    There are three problems with your code above.

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

    Code:
    <![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.

    Code:
    <!--[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.

    Code:
    <!--[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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •