Closed Bug 685671 Opened 13 years ago Closed 13 years ago

blank margin on top of body even with margin 0 and padding 0 in style

Categories

(Firefox :: General, defect)

6 Branch
x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 451791

People

(Reporter: matteosistisette, Unassigned)

Details

Attachments

(2 files, 2 obsolete files)

1.32 KB, application/octet-stream
Details
465 bytes, text/html
Details
Attached file testbug.zip (obsolete) —
User Agent: Mozilla/5.0 (X11; Linux i686; rv:6.0.2) Gecko/20100101 Firefox/6.0.2
Build ID: 20110902133214

Steps to reproduce:

open the attached html file (test.html)


Actual results:

the page has a blank margin on the top.
If you inspect with firebug you'll find out that blank space belongs to the "html" node, i.e. it is outside of body or is body's margin.


Expected results:

There shouldn't be any margin on top, since the stylesheet says "margin: 0" for the body element.

Compare with other browsers: Firefox seems to be the only one that will show the margin on this page. Neither Google chrome nor Opera do. Of course this doesn't prove anything, it just _suggests_ that I'm not crazy.
Attached file test html file (obsolete) —
Attachment #559266 - Attachment is obsolete: true
Attached file better test case
I've narrowed down the issue. The problem seems to be the "h1" that follows the div; h1 probably has a top margin; however it makes absolutely no sense that this top margin propagates to the parent. There's a sibling before the h1.

If you comment away the h1, the bogus margin will disappear.

Now the html of the attached file is valid, by the way.
Attachment #559267 - Attachment is obsolete: true
Oh, this may be a dup of #451791
Attached file reduced testcase
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: