[thelist] Internet Explorer ignoring margin

Nan Harbison nan at nanharbison.com
Wed Feb 4 15:01:09 CST 2009


Is this a div with no text in it? I am not sure your problem fits this IE
bug, but sometimes IE will behave if you put a comment inside the div, here
is a good one:
<!-- IE SUCKS! -->


-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Garth Hagerman
Sent: Wednesday, February 04, 2009 2:22 PM
To: thelist at lists.evolt.org
Subject: Re: [thelist] Internet Explorer ignoring margin

 > 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
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.


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



* * Please support the community that supports you.  * *

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 

More information about the thelist mailing list