Closed
Bug 788566
Opened 12 years ago
Closed 12 years ago
margin-top of an element following an empty element with clearance renders incorrectly
Categories
(Core :: Layout: Block and Inline, defect, P2)
Tracking
()
RESOLVED
DUPLICATE
of bug 451791
People
(Reporter: selenit, Unassigned)
Details
Attachments
(1 file)
The empty block element with 'clear: both' (which is one of the most popular solutions of the "containing floats" problem) causes the incorrect display when the block that follows the container of such element has 'margin-top'.
The demo of the bug is attached. In all browsers except Firefox (tested in version 15 on Windows 7 x86) the top gray block with floats and empty clearing div is rendered right after the top border of the parent block. But in Firefox it seems that the margin-top of the second (pink) block is somehow duplicated above the gray block, making the red background of the outer container visible.
When the div with 'clear' becomes nonempty (after adding content to it), and when it establishes new block formatting context (e.g. after adding 'overflow: hidden' or 'display:table' to its style), the bug disappears, so this can be used as a workaround.
But I believe that this bug should have high priority because the empty clearing div technique of containing floats is widely used on the Web.
Attachment #658525 -
Attachment mime type: text/plain → text/html
Comment 1•12 years ago
|
||
Dup bug 451791
Updated•12 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•