New IE7 css hack...

Discussion in 'CSS' started by Alex-Grim, Oct 30, 2006.

  1. #1
    It is widely known that most of the IE css hacks are at 'the end of the road' as the parser for IE-7 is supposed to be improved, this is bad for people who need to write css hacks for IE's lack of standards, because it means they can't mantain a consistant layout between IE and the rest of the world.
    Well, if you need IE < 7 to do something particular, you can keep using the apropriate hacks. But if you need IE-7 to do something particular, try writing the css for IE-7 and preceed ALL of it with '//'. I'm not sure if anyone else has come across this or not, but it ONLY works with IE-7, everything else thinks it's a comment. I came across it on accident, when i edit things for sites, i usually have the xhtml, css and javascript open at the same time in Gedit, and got mixed up and started using javascript comments in my css, and well, IE-7 will still read it while every other browser including 6 thinks it's a comment;)
    _________________
    http://AlexGrim.com
    http://GrimMusic.com
     
    Alex-Grim, Oct 30, 2006 IP
  2. MrSupplier

    MrSupplier Peon

    Messages:
    141
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Standart CSS comment style is /* */
    // won't comment anything for you, but it can work like hack by accident
     
    MrSupplier, Oct 30, 2006 IP
  3. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #3
    That works well, the only problem is it's invalid CSS. It's never good because it can cause numerous problems down the line.

    Here's the triple x hack: http://www.brothercake.com/site/resources/reference/xxx/

    Never used it yet, found IE7 quite ok so far, but it might be useful. However it could throw off some other not so mainstream browsers.
     
    AdamSee, Oct 30, 2006 IP