Posted By

catchamonkey on 01/23/08


css include html if

Versions (?)

Who likes this?

4 people have marked this snippet as a favorite


Conditional css inclusion

 / Published in: HTML

  1. <!--[if lte IE 6]>
  2. <link rel="stylesheet" type="text/css" href="/css/ie6_fix.css" />
  3. <![endif]-->
  4. <!--[if IE 7]>
  5. <link rel="stylesheet" type="text/css" href="/css/ie7_fix.css" />
  6. <![endif]-->

Report this snippet  


RSS Icon Subscribe to comments
Posted By: vsync on January 30, 2008

remember that a good coder don't use these things, so if u happen of a need to this.. u're probably doing something wrong :)

Posted By: catchamonkey on January 31, 2008

Also remember that a lot of people do use horrible code, and I don't always have the time to go through it all for them and seeing as this is one of the things I am frequently explaining it's easier to point them here.

I don't think I have ever used conditional inclusions.

Posted By: d4rk on February 13, 2008

So you're not a 'good' coder if you use conditional includes to fix a broken browser? Tell that to the guys who made Snipplr. (Have a peek at the source and see for yourself)

Personally I see nothing wrong with using conditional comments. They still allow the page to validate and make it easy to separate odd CSS for bad browsers (IE) from good CSS for good browsers (everything else).

You need to login to post a comment.