Here are some quick tips and precautions that you can take that will hopefully save you a bit of hair when you decide to look at your code in a Internet Explorer. Most of these CSS tips are aimed at IE 6, but some are also relevant to IE 7.

- Do Reset Browser Styles
- If you float something, add display:inline; to avoid double margins
- Clear:both on your footers
- Always specify a:link, a:visited, a:hover, a:focus and a:active
- For IE always specify overflow:visible.
- Avoid pngs or use workarounds.
- On having layout – Most of IE 6’s problems can be avoided by adding has layout to elements.
- Define
min-widthandmax-widthin IE
Width:#container
{
min-width: 600px;
max-width: 1200px;
width:expression(document.body.clientWidth < 600? "600px" : document.body.clientWidth > 1200? "1200px" : "auto");
}Height:
.box
{
width: 80px;
height: 35px;
}html>body .box
{
width: auto;
height: auto;
min-width: 80px;
min-height: 35px;
}
More info - Use conditional statements to add a seperate stylesheet, which makes ie play nice:
<!--[if IE]> <link rel="stylesheet" type="text/css" href="ie.css" /> --> <![endif]-->
References and more info:
CSS tips












