If IE statement

Discussion in 'CSS' started by selfdeprecate, Jun 22, 2010.

  1. #1
    This is the code our designer used to distinguish different style sheets for IE and non-IE browsers:

    <link href="/css/me_style.css" rel="stylesheet" type="text/css" />
    <!--[if IE]>
    <link rel="stylesheet" type="text/css" href="/css/me_style_ie7.css" />
    <![endif]-->
    Code (markup):
    The problem is this doesn't do anything. IE and non-IE browsers are using me_style.css no matter what as far as I can tell and we have tons of render errors using Explorer. I would love not to support this trash browser but according to Analytics ~50% of our users are viewing with IE.

    What can I do to get the proper me_style_ie7.css loaded in an IE browser?
     
    selfdeprecate, Jun 22, 2010 IP
  2. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #2
    That should work. Maybe the IE stylesheet is in the wrong place or the filename is wrong. Try using absolute urls.
     
    Cash Nebula, Jun 22, 2010 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    A better question would be, "how can I code this page so that I don't have to use a second stylesheet?"

    cheers,

    gary
     
    kk5st, Jun 22, 2010 IP
  4. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #4
    Do you want the IE stylesheet to replace the normal stylesheet? If so, make it the preferred one. To the IE link element, add "title='ie'". Having a title makes it the preferred version. IE will ignore the other link.

    cheers,

    gary
     
    kk5st, Jun 22, 2010 IP