About Conditional Comments

23rd Nov 2005

Everyone knows that all good web designers keep their Internet Explorer specific styles in a seperate stylesheet. These styles are then called in using Conditional Comments. With the forthcoming release of Internet Explorer 7 set to shake the web world to it's foundations, now's the time to think about how you deliver styles to versions other than Internet Explorer 7. Well, the answer to that is easy, do this:

<!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="/css/ie.css"> <![endif]-->

What you're saying here is this: if any version of IE that is less than IE 7 then feed it the specific ie.css file. Simple!