On 7/24/07, H. Bartel <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a recurring problem, which I know how to solve, but I don't know why 
> that is..
>
> Having two <div>'s with a margin of 10px in beetween them results in a margin 
> slightly larger than 10px. If the top <div> has border-top or border-bottom 
> defined the result is a correct 10px margin. I believe this only happens, if 
> the top div doesn't contain anything.
>
> I'm quite sure, that I've already read about it before, but can't find it 
> anymore.
>
> An explanation to a probably very common problem would be appreciated ;)
>
search for "margin collapsing" - it is a moderately complex behaviour
described in the standards, made more fun by MSIE (of course) having
some bugs with it.
As to the "more than 10px" - I would gess that you are seeing a
combination of the larger of the two margins (10px) and the top or
bottom padding of one or other of the elements. Of course as soon as
you declare a border to test that, the margins will no longer
collapse.

-- 
Richard Grevers, New Plymouth, New Zealand
Dramatic Design www.dramatic.co.nz
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to