Closed Bug 542972 Opened 14 years ago Closed 14 years ago

margin-bottom + float affects bodys top margin

Categories

(Core :: Layout: Block and Inline, defect)

defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 451791

People

(Reporter: hcs88, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 FirePHP/0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 FirePHP/0.4

giving a div with floated divs inside a margin-bottom, this margin will be added on top of body.

example:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
	<div style="margin-bottom: 50px;">
		<div style="float: left; width: 100px;">lorem ipsum</div>
		<div style="float: left; width: 100px;">dolor sit amet</div>
		<div style="clear: both;"></div>
	</div>
	
	consectetur adipiscing elit.
	
	</body>
</html>

Reproducible: Always

Steps to Reproduce:
1. open example html in firefox
Actual Results:  
margin is added on top of body

Expected Results:  
margin at the bottom of div only
This is very similar to bug 451791, where the top-margin of an element after the clearing element is duplicated.
Component: General → Layout: Block and Inline
OS: Windows XP → All
Product: Firefox → Core
QA Contact: general → layout.block-and-inline
Hardware: x86 → All
Attached file test case
testcase based on comment 0
(In reply to comment #1)
> This is very similar to bug 451791, where the top-margin of an element after
> the clearing element is duplicated.

It is a dupe, the only difference to bug 451791 is, that the problematic margin is defined on the float's parent element. Aside from that, the exact same calculation methods are used.
Status: UNCONFIRMED → RESOLVED
Closed: 14 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: