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

RESOLVED DUPLICATE of bug 222059

Status

()

Core
Layout
--
minor
RESOLVED DUPLICATE of bug 222059
11 years ago
11 years ago

People

(Reporter: memso, Unassigned)

Tracking

1.8 Branch
x86
Windows Server 2003
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
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)
(Reporter)

Comment 1

11 years ago
Created attachment 258081 [details]
Test case that shows the bug using BG colors and a border

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

Comment 2

11 years ago
Please visit bug 358651 comment #c9 for explanations

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