Closed Bug 373608 Opened 18 years ago Closed 18 years ago

CSS: margin is transfered to parent element if it has no border

Categories

(Firefox :: General, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: marty, Unassigned)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2 When nesting (block-level) elements, the margin of an element is transfered to its parent when that parent doesn't have a border defined Reproducible: Always Steps to Reproduce: 1. nest a few divs (without border) 2. give them different background-colours 3. define a top-margin for a nested div and look what happens to its parent 4. now define borders and look what happens again Actual Results: Without border, the parent div will take the margin of the nested div Expected Results: the div with the margin defined should display this margin, not its parent I'm using firefox 2.0.0.2
Attached file shows the bug
I'm pretty sure that's collapsing margins which is in the CSS spec. http://www.w3.org/TR/CSS21/box.html#collapsing-margins
(In reply to comment #2) > I'm pretty sure that's collapsing margins which is in the CSS spec. > http://www.w3.org/TR/CSS21/box.html#collapsing-margins > I agree
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: