Closed Bug 207010 Opened 21 years ago Closed 21 years ago

Setting margins for and element within a DIV seems to apply the margin to the DIV and not to the element

Categories

(Core :: Layout, defect)

x86
Other
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: mozilla, Unassigned)

Details

Attachments

(2 files)

User-Agent:       Opera/7.11 (Windows 95; U)  [en]
Build Identifier: Mozilla/5.0 (Windows; U; Win95; en-US; rv:1.3.1) Gecko/20030425

Running Moz 1.3.1 on Win95b.

I have attached a testcase and a screenshot of it.

The testcase has a DIV at the top. Within the DIV is a P. The DIV, BODY, and 
HTML elements all have margin and padding set to 0em. The P in the DIV has 
margin and padding set to 0em. The margin-top and margin-bottom for the P seem 
to be applied to the DIV instead.

Reproducible: Always

Steps to Reproduce:
1. Load test case.
Actual Results:  
The DIV is given the margin of 1em.

Expected Results:  
The margin should have been given to the P.

Occurs using bot Pinball and Modern themes.
Attached file Original testcase
Sorry, forgot to attach testcase and screenshot...
Edit (typo): Original report should have said "The P in the DIV has 
margin and padding set to 1em." (It incorrectly said "0em.")

Sorry for the messy reporting.
Oddly enough, IE renders it exactly the same as Mozilla :)
INVALID. What we are doing is correct per the CSS2 specification. See:
   http://www.w3.org/TR/REC-CSS2/box.html#collapsing-margins
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: