CSS for IE 7 only
The new IE 7 is a huge step in the right direction for Microsoft, but it’s still lacking in some areas.
There are still some significant differences in the way IE 7 and other browsers like Firefox and Safari handle some CSS. But there is a some what simple way around this, Microsoft recognizes it’s short comings and has built in something called Conditional Comments that are kind of like regular HTML comments.
You’ll need to create a CSS file for any IE 7 only commands and then use these conditional comments to send this CSS file only to IE 7. To do this, place the following code into the header of each HTML file, after the link for the main CSS file.
- <!--[if IE 7]><link rel="stylesheet" type="text/css" href="IE7styles.css" /><![endif]-->
The only CSS you need to place into this extra file are those which will override commands in the main CSS file. You don’t need to duplicate commands across the two CSS files as IE7 will also read through the main CSS file.
And remember that conditional comments can only be placed inside HTML files and not CSS files.