IE 6 Margin Fix
I’ve been struggling with this issue as I’m sure a lot of people out there are as well. But have crawled the web and found a great solution for all of you wrestling with IE6 and its horrible rendering capabilities. Its easy and fast and you don’t have to load a whole new style sheet to accomplish.
The Code:
#divbox {
margin: 3px;
}
Now in this case, left and right margins will be doubled. With floated divs display:inline; will solve most of your problems.
Example:
#divbox {
margin: 3px;
float:left;
display:inline;
}
But what if your having trouble with top or bottom margins. Well there is a simple solution. Since IE 6 sucks, you have to create 2 different styles for margin.
The Code:
#divbox {
margin: 3px;
_margin: 0px;
}
The first declaration will be read by all cool browsers (IE 7, Fire Fox, Safari) but as we all know IE6 is dumb so it will read the last margin declaration. Quick and easy. Figured I’d share this since I took me a while to find it out there.
Popularity: 20% [?]
