Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Aug 2009
    Posts
    410
    Thanks
    119
    Thanked 0 Times in 0 Posts

    IE CSS hack troubles

    how come the IE 6 specific hack i have in place is also being applied in regular IE 8?

    thanks in advance!

    Code:
    <link href="../style_sheets/pt_style.css" rel="stylesheet" type="text/css" />
    
    <!–-[if IE 6]>
    <link rel="stylesheet" href="../style_sheets/ie.css" type="text/css" media="screen" />
    <![endif]–->

  • #2
    Regular Coder seco's Avatar
    Join Date
    Nov 2008
    Location
    Oregon
    Posts
    687
    Thanks
    6
    Thanked 79 Times in 77 Posts
    cause <!–-[if IE 6]> isnt a hack.

    try

    Code:
    <!--[if lte IE 6]>
        css link here
    <![endif]-->

  • #3
    Regular Coder
    Join Date
    Aug 2009
    Posts
    410
    Thanks
    119
    Thanked 0 Times in 0 Posts
    i tried that too. here's what i have now;

    Code:
    <!–-[if lte IE 6]>
    <link rel="stylesheet" href="../style_sheets/ie.css" type="text/css" media="screen" />
    <![endif]–->
    however, it's effecting IE 8. any idea why???? thanks.

  • #4
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,957
    Thanks
    9
    Thanked 727 Times in 721 Posts
    Got a link to your page?

  • #5
    Regular Coder
    Join Date
    Aug 2009
    Posts
    410
    Thanks
    119
    Thanked 0 Times in 0 Posts
    PM sent with URL.

    actually it gets even more bizarre. apparently its effecting Firefox as well?!

    any ideas? thanks!
    Last edited by sixrfan; 09-22-2009 at 03:26 PM. Reason: me no type good.

  • #6
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,957
    Thanks
    9
    Thanked 727 Times in 721 Posts
    Weirdest of the day...

    It's your if statement: <!–-[if lte IE 6]>

    If you look closely, the first dash after the exclamation mark isn't a dash - it's another character - so the statement isn't being interpreted as a comment/conditional for IE - so everything including IE8 and Firefox is using the ie.css.

    Hard to spot - I pasted into DW and it looked identical to a correctly formatted statement - although DW highlighted it as an error. Had to paste into Word before I could see the difference....

  • Users who have thanked SB65 for this post:

    sixrfan (09-22-2009)

  • #7
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    If you look closely, the first dash after the exclamation mark isn't a dash - it's another character
    Brilliant! both you and the OP
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #8
    Regular Coder
    Join Date
    Aug 2009
    Posts
    410
    Thanks
    119
    Thanked 0 Times in 0 Posts
    friggin brilliant catch. i would not have spotted that or even known to spot it in a million years. thank you!


  •  

    Posting Permissions

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