[thelist] Internet Explorer ignoring margin

Garth Hagerman hagerman at mcn.org
Wed Feb 4 13:22:18 CST 2009


>
 > For almost
 > an entire site, most versions of Internet Explorer (v. 9 gets it
 > right) ignore the top margin on a div.
 > Sounds to me like it might be a case of collapsing margins.
Thanks, Sarah. That led me on the path to a solution. There seem to  
several collapsing margins bugs, or ways to trigger the same bug, or  
sub-bugs, or something. My initial research just found variations  
triggered by floating elements. The various discussions of margin  
collapsing in IE led me to try:
1. Adding a background-colored top border to the content div. That  
didn't work.
2. Defining a height for the content div. That didn't work, either.
3. Adding a dummy div before the content div. Bingo!
While the dummy div is a bit of a kludge, at least it's a simple one.

    Garth


                            * * * * * * * * * * * * * * * *
                                my online portfolio

                           http://garthhagerman.com/





More information about the thelist mailing list