Closed Bug 287982 Opened 20 years ago Closed 20 years ago

css style margin propagates from child element to parent

Categories

(Firefox :: General, defect)

x86
Windows 2000
defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 279980

People

(Reporter: freddofrog57, Assigned: bugzilla)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2

at http://chubborg.com.au/ff/test1.html the outer nested DIV element is
positioned incorrectly. The margin from the inner DIV element appears to have
been applied to the outer element. The margin on the inner element is not
applied WRT it's container, but ends up being positioned correctly WRT the
document body.

Note that the outer element contains no text. If text or nbsp is introduced
prior to the inner DIV element, the page is rendered as expected.

This behaviour has been observed on the following platforms:

win2k + ff 1.0.2
win2k + moz 1.7b
ubuntu warty + moz 0.9.3

Reproducible: Always

Steps to Reproduce:
1. navigate to http://chubborg.com.au/ff/test1.html
2. save source and insert text or nbsp between opening outer and inner nested
DIV elements


Actual Results:  
Page was rendered incorrectly in first instance.
Page was rendered as expected in second instance.


Expected Results:  
The top of the green (outer) div should start immediately after the base of the
yellow div.
The top of black (inner) div should be 20px below the top of the green (outer) div.

None.
The margins collapse as they should.

See:
http://www.w3.org/TR/CSS21/box.html#collapsing-margins
http://www.w3.org/Style/css2-updates/REC-CSS2-19980512-errata.html#x17
bug 4483
and especially bug 279980

*** This bug has been marked as a duplicate of 279980 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.