SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up New IE7 css hack...

    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
    Never underestimate determination...
    Dark Elysium
    The Underground
    Registered Linux user no 433728

  2. #2
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or better yet, just code to standards, get the CSS to work in IE 7, Gecko (that includes FireFox and Netscape), Opera and Konqueror/Safari, then use a conditional comment to serve a link to an IE 6 stylesheet.

    Note I said only IE 6. No mention of IE 5 is made. That browser generation was initially released in 1999. It's 2006. Therefore I refuse to support it anymore.

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2004
    Location
    Fort Worth, Texas
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Schulz
    Note I said only IE 6. No mention of IE 5 is made. That browser generation was initially released in 1999. It's 2006. Therefore I refuse to support it anymore.
    I know.. it is about time we stop catering to IE5 on general sites. There are sites that do still need to worry about IE5 users like government and corporate websites - but for the general new site we do not.

    Anyhow, Alex - I haven't yet heard of this method but I completely agree with Dan, a seperate set of commented styles just isn't necessary.

  4. #4
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll still support IE 5.5, but not IE 5.01 or IE 5/Mac.

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,481
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by all4nerds
    Is this the way to use it ?, if so it's not working and validating it you get an error
    I couldn't get it to work either.


    Quote Originally Posted by alex-grim
    Well, if you need IE < 7 to do something particular,
    Be very wary of using hacks to target IE7 because it is not a dead browser and will be updated constantly during it life and any of these hacks could be fixed at any time and break your layout.

    You can of course used adavanced features to target ie7 as opposed to ie6 but if you want to target only ie7 and no other browers then i would stick with conditional comments as it will then be safe for all time.

    For interests sake though can you post a working example of the hack?

  6. #6
    SitePoint Wizard drhowarddrfine's Avatar
    Join Date
    Aug 2005
    Posts
    3,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Be very wary of using hacks to target IE7 because it is not a dead browser and will be updated constantly during it life and any of these hacks could be fixed at any time and break your layout.
    Paul, you didn't mean IE7 there, did you?

  7. #7
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,481
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    Paul, you didn't mean IE7 there, did you?
    To which bit are you referring? I suspect you mean the bit about it not being a dead browser

  8. #8
    SitePoint Enthusiast jeffrey.pry's Avatar
    Join Date
    Oct 2006
    Location
    United States of America
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wow
    -----------------
    Jeffrey Kevin Pry

  9. #9
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    I understand that you are happy for having found a new method to serve a hack to IE7. But, if you intend to design for anything other than personal sites, you'll not get around to using a separate stylesheet for IE anyway, even if it were just one rule for IE specifically, I'd put it in a separate stylesheet. And since I then already have the extra pie for IE, I include bug fixes into the IE stylesheet as well and order each set of rules by version. I find this the cleanest method because hacks generally don't have anything to do in a modern stylesheet (IMHO). Bugs need to be treated as bugs and so I find the solution to fix these bugs via serving conditional statements to IE the cleanest solution.
    Maleika E. A. | Rockatee | Twitter | Dribbble




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
  •