Inserting a P inside a DIV causes a 10-15px margin to appear above the DIV

RESOLVED INVALID

Status

()

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

People

(Reporter: Julian Turner, Unassigned)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113

I create a simple DIV as the firstChild of BODY, thus

<body style="margin: 0pt; padding: 0pt;">
<div style="margin: 0pt; padding: 0pt; background-color: green;">
<p>Test</p>
</div>


It renders with a 10-15px white margin at the top, except when 
position:absolute is set.

Reproducible: Always
Steps to Reproduce:
See details, just cut and paste the code into a blank page.

<body style="margin: 0pt; padding: 0pt;">
<div style="margin: 0pt; padding: 0pt; background-color: green;">
<p>Test</p>
</div>
</body>

Actual Results:  
It renders with a 10-15px white margin at the top, except when 
position:absolute is set.

Expected Results:  
Rendered the div at line 0.
The <p> has a 1em top and bottom margin.  The top margin collapses with the
margin of the <div>, correctly.  See
http://www.w3.org/TR/CSS21/box.html#collapsing-margins
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.