On 10 Aug 2005, at 4:12 pm, Maren Child wrote:

I've been trying out what happens with the box model and collapsing margins. In this page: http://www.wordsworth.com.au/test0508/boxmodeltest.htm I can't see why in Firefox the top and bottom margin of the container div disappears
but in IE6 it is there.
Can someone explain this to me?

Firefox is correct in what it does (and Opera, Safari). It is a classic case of collapsing margins [2]. The margins didn't disappear, they collapsed to the outside.

IE doesn't do the same for two reasons:
1/ it doesn't do collapsing margins very well.
2/ the outer box (container) 'hasLayout' [1], because you declare a width on it. In that case, IE prevents margin-collapsing.

Give your boxes a top and bottom border, and watch how differently they behave in decent browsers.

[1] http://www.satzansatz.de/cssd/onhavinglayout.html
[2] this is a good article on the subject: <http://www.andybudd.com/archives/2003/11/no_margin_for_error/>

Philippe
---
Philippe Wittenbergh
<http://emps.l-c-n.com/>

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to