If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

margins from block-level elements immediately within a div bleed out into the div's margin

RESOLVED INVALID

Status

()

Core
Layout: Block and Inline
RESOLVED INVALID
14 years ago
14 years ago

People

(Reporter: Joseph, Unassigned)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7a) Gecko/20031219
Build Identifier: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7a) Gecko/20031219

When creating pages with block-level elements within a div, if the elements
aren't surrounded by inline elements [i.e. text or a  ], then the top and
bottom margins from the block-level elements are used as appropriate [top if the
element is immediately following the <div>; bottom if it's immediately preceding
the </div>] get stuck into the div's margins.

Unless I misunderstand the specs, the element's top and bottom margins should be
filled *inside* the div; not outside it.

If you need, I can provide a simple test case.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
See:
http://www.w3.org/TR/CSS21/box.html#collapsing-margins
http://www.w3.org/TR/CSS21/visudet.html#q19
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → INVALID
(Reporter)

Comment 2

14 years ago
Thanks for the pointers.

For the record, how does one prevent collapsing the margins?  It's definitely
not what I wanted.
nonzero border or padding is the easiest way.
You need to log in before you can comment on or make changes to this bug.