SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot stikkybubble's Avatar
    Join Date
    Sep 2006
    Location
    Pluto
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE7 not ignoring conditional comments for IE6

    Hi,
    This is a problem I have come across twice recently - IE 7 refusing to ignore conditional comments aimed specifically at IE6. I have tried various different methods, including copy-pasting directly from the microsoft page on conditional comments and IE7, but so far nothing works.

    Has anyone else encountered this? At the moment, the latest attempt reads:

    <!--[if lt IE 7]>
    <link rel=\"stylesheet\" type=\"text/css\" href=\"iexplore6.css\" />
    <![endif]-->
    (in php script)

    ... but as I said I have tried many varieties of the above, and even copied and pasted example code from websites that is supposed to detect browser version & display different text ("you are using IEx!"). IE7 so far always displays BOTH content aimed at IE6 and IE7.

    Is there a trick to this? Has anyone else had this problem? I don't use conditional comments very often but I never had any problems before - or is it just that I never had to worry so much about versions of IE and didn't notice something I'm doing wrong .... ?

  2. #2
    SitePoint Zealot
    Join Date
    Feb 2009
    Location
    Baton Rouge, LA
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That is odd. Have you tried going with <!--[if IE 6]>?
    "The browser is your first client" - Quote: Myself
    Please visit me at: vanillacloud.com

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Try [if lte IE 6]
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  4. #4
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you have installed IE6 as well, it might have overridden the relevant stuff in the Windows registry to make conditional comments in IE7 think the version is "6".

    There's a way to fix this by changing things in the registry. IIRC, the relevant advice might be in http://www.positioniseverything.net/...s/multiIE.html
    Simon Pieters

  5. #5
    SitePoint Zealot stikkybubble's Avatar
    Join Date
    Sep 2006
    Location
    Pluto
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes I tried those suggestions before (IE 6, lte IE 6) and it didn't work.
    I do have multiple IE versions on my computer but this is also affecting what I see on a web-based service that allowed me to view different versions of IE. I'd give the link but it has gone from my browser history & I can't seem to find it just now!
    I suppose it's possible that their web service is foxed by having multiple versions of IE as well!
    I will have to try the registry editing suggestion. Sounds drastic but obviously I'm stuffed if I can't get proper previews. I did read that conditional comments respond asif each IE is the highest version on your machine, but if that's what is causing this it's an inaccurate description which confused me. IE6 and IE7 aren't behaving identically, and it's only (so far) impossible to get IE7 to ignore comments meant for previous versions.
    If it works I will try to post back here what I did.

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

    The problem is most likely to be your multiple IE installs.

    Download IEtester instead which works fine with CCs and then you will know for sure.


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
  •