Closed Bug 168003 Opened 23 years ago Closed 23 years ago

margin-top collapsed on a floating box and adjacent box

Categories

(Core :: Layout, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: cplyon, Assigned: attinasi)

Details

(Keywords: testcase)

Attachments

(1 file, 1 obsolete file)

Using build 2002091004 on WinXP Steps to reproduce: Create a webpage with these two lines: <div style="float:left; width:100%;">borderless floating div</div> <div style="border:1px solid black">bordered div</div> Expected Results: According to the CSS2 spec, the margins should not collapse. Therefore, the border should only enclose the 2nd div Actual Results: Border encloses both divs. Furthermore, adding any margin-top properties to the second div has no effect.
Attached file testcase (obsolete) —
Attached file Testcase #2
Attachment #98743 - Attachment is obsolete: true
Normally the text in the second DIV would flow to the right of the floater, but since you specified width:100% for the floater it was pushed to the next line. The normal flow DIV is placed regardless of any floaters, you can see that this is the case since the floaters overlaps the borders. DIV doesn't have a default margin, so margin collapsing isn't involved here. See http://www.w3.org/TR/CSS2/visuren.html#floats "Since a float is not in the flow, non-positioned block boxes created before and after the float box flow vertically as if the float didn't exist." --> INVALID
Status: NEW → RESOLVED
Closed: 23 years ago
Keywords: testcase
OS: Windows XP → All
Resolution: --- → INVALID
>Normally the text in the second DIV would flow to the right of the floater, >but since you specified width:100% for the floater it was pushed to the next line. Yes, I agree that this is the correct behaviour. >The normal flow DIV is placed regardless of any floaters, you can see that this >is the case since the floaters overlaps the borders. I don't quite understand what you mean. The first div isn't overlapping the border, the border is resized to enclose it. It's hard to tell in your testcase because of the yellow background. >DIV doesn't have a default margin, so margin collapsing isn't involved here If that is true, why doesn't margin-top:100px; work when applied to the second div? Reopening until I get a more complete explaination.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Ok, I get it now. Sorry about the spam.
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: