Posted in 3523 Adv Web Design - S09
Monday, April 20th, 2009 at 8:49 pm

Add an IE-specific stylesheet

If you run into the need to tweak things to work right in Internet Explorer, one of the best and recommended methods is to use the IE conditional comment filter, which you insert into the head of the document.

To import a specific stylesheet for IE 7:

<!--[if IE 7]
<style type="text/css">
@import ("css/ie7.css");
</style>
-->

To import a specific stylesheet for IE 6:

<!--[if IE 6]
<style type="text/css">
@import ("css/ie6.css");
</style>
-->

To import a specific stylesheet for any version of IE less than IE 6:

<!--[if lt IE 6]
<style type="text/css">
@import ("css/ielt6.css");
</style>
-->

Leave a Reply