About using CSS hacks

The other day I posted my thoughts on the use of CSS hacks in Stop using CSS hacks now. I rarely use CSS hacks, so I was a bit surprised to see so many people defend them.

Anyway, I do agree that whichever method you use to send different CSS rules to Internet Explorer you’ll have to be prepared to change some things when IE7 is finally released. Eric Meyer has written a couple of posts on the pointlessness of doing anything now: IE7 and IE7 and To Hack With It. Jonathan Snook has similar feelings: IE7 and the use of CSS Hacks. Both of them make good points.

So the conclusion is that whether you use CSS hacks, conditional comments, or neither, you will need to check if your sites are still OK when Internet Explorer 7 is released.

Posted on October 20, 2005 in Browsers, CSS, Quicklinks

Comments

  1. …you will need to check if your sites are still OK when Internet Explorer 7 is released

    Of course, we need to know and test how IE 7 will actually work.

    While Eric and Jonathan make good points, I personally promote using conditional comments for reasons expressed in Avoid CSS hacks (mostly in my comments) and in my comment at Eric Meyer’s web site).

    And it’s not like IE 5 and IE 6 are going to go away just because IE 7 is being released (which will only work in Windows XP SP 2 and Windows Vista); we need to have a good, structured solution for the old IEs for a long time to come (probably for at least five more years…).

    For everyone else out there, use what you feel is appropriate. But before you opt for hacks, make sure to read and grasp Chris’ comment: CSS parser support and CSS parser bugs are two vastly different things.

  2. October 20, 2005 by Roger Johansson (Author comment)

    Robert: I somehow managed to miss your post. Seems like we are in full agreement on this one ;-).

  3. Having used ‘conditional comments’ for a long time, I’m not too worried about old hacks breaking IE7.

    How well they actually fix IE7 is another matter. We just have to wait and see.

  4. Assuming that everyone of us already tests his pages, that’s no news, actually ;)

  5. October 21, 2005 by Roger Johansson (Author comment)

    Jens: Hehe. Nope ;-).

  6. I still confused what CSS Hack for? to reformat on different browser? or something else?

    Thanks

  7. October 22, 2005 by Roger Johansson (Author comment)

    Jauhari: CSS hacks are almost always used to send different rules to Internet Explorer, to compensate for its buggy CSS implementation.

Comments are disabled for this post (read why), but if you have spotted an error or have additional info that you think should be in this post, feel free to contact me.