Keith Watanabe * NET 2.0

Internet Explorer Bug Fix For Margins, Floats and Disappearing Backgrounds
By: Keith Watanabe
Published On: 3-8-2008

One of my fears about Yahoo losing the shareholder battle to M$ is that MSIE will become even more dominant, despite the fact that it's a crappy browser and hard to program (well at least for a linux dude like myself :p).  But the main thing I want to share is a few tips on some of the horrible excursions I dealt with in MSIE:

Float and the Double Margin Bug

Apparently, MSIE suffers from a nasty little bug where if you float an element and provide a margin, MSIE will double the size of the margin either left or right.  To counter it, you need to add:

display: inline (or block)

for your class that you're employing the float.  There's a lot of resources on the web for why this occurs as well as more details on this.

Next, there's another annoying bug that I encountered and spent hours knocking my head against my table (okay, not literally).  It's where backgrounds disappear if you have numerous div tags and use the background-color attribute.  The quick fix is to trick MSIE into redrawing the section, so you add a height attribute of say 1%.  The code would look like this:

height: 1%;

Put that in the class that has the background-color attribute and these should disappear.

AddThis Social Bookmark Button Sphere: Related Content

Trackbacks: (Trackback URL)

No Comments Posted Yet
December [January] February
Sun Mon Tue Wed Thu Fri Sat
28 29 30 31 1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31