Joe Howley wrote:
> > The other day, I noticed that Mozilla allowed the margins of a p
> > tag that was the first child of a div to escape from the p and
> > affect the div instead.
--- Scott Sauyet [EMAIL-REMOVED]> wrote:
> Maybe I misunderstand the spec, but it seems to me that this is
> would likely happen from the collapsing vertical margins described
> here: http://www.w3.org/TR/REC-CSS2/box.html#collapsing-margins.
> "Two or more adjoining vertical margins of block boxes in the
> normal flow collapse. The resulting margin width is the maximum of
> the adjoining margin widths."
> The example on the W3C site only points out the collapsing of the
> bottom margin of one block element and the top margin of the
> one, but I would guess that it applies equally to nested boxes.
The important word here is 'adjoining'. This seems to exclude nested
boxes. I wonder if the <p> margin will 'escape' thru more than one
nested div top edge. (?)
No matter how it's 'supposed' to work, it's still a design headache,
and a useful demo. Thanks Joe!
Note to Joe: try applying different rules (background/padding/margin,
etc.) to the various elements. Could be that something will 'kill'
this bug. Worth a shot. :]
"What the world needs is a good bug ring"--Big John
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup