Closed Bug 373420 Opened 16 years ago Closed 16 years ago

margin-top of first inline inner content block applies to outer content block

Categories

(Core :: Layout, defect)

1.8 Branch
x86
Windows Server 2003
defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 222059

People

(Reporter: memso, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2

CSS property margin-top.

Whenever the first inline (not floating/absolute) child block has a margin-top, it is applied to the parent block instead of the child block.

Reproducible: Always

Steps to Reproduce:
1. Create a <div> or other block-level region
2. Create another <div>, <p> or block level region inside of the first
3. Assign a margin-top (via margin-top or margin in CSS) to the second block region.

Actual Results:  
The top margin is applied to the outer div, not the inner div. This does not occur on any other margins, just margin-top.

Expected Results:  
The inner div would have a margin at the top.

This seems to happen on any block regions though I haven't tested them all.

This causes the bug:
<div>
  <div style="margin-top: 10px;">Test</div>
</div>

This is a "work around" that always works:
<div>
  <div style="padding-top: 10px;"><div>Test</div></div>
</div>

Found in:
WinXP x64 SP1 (FF v1.5.0.9, FF v2.0.0.2, Minefield v3.0a3pre 2007-03-09 build)
WinXP Pro SP2 (FF v1.5.0.9, FF v2.0.0.2)
You should see a dotted black border surrounding 10px of light blue, 20px of red and 34px of light blue. The bug causes inside the border to have 10px of white (browser default color), 20px of red, 44px of light blue.
Component: General → Layout
Product: Firefox → Core
QA Contact: general → layout
Version: unspecified → 1.8 Branch
Please visit bug 358651 comment #c9 for explanations

Resolving as DUPLICATE of bug 222059
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.