Closed Bug 275366 Opened 20 years ago Closed 20 years ago

margin just gets colored when border

Categories

(Core :: Layout, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: kraftb, Unassigned)

References

()

Details

Attachments

(1 file)

I found out the following: If you have a <DIV class="outer"> which has assigned a background-color, and in it another DIV <DIV class="inner"> which hasn't got a background-color but a margin, then the margin's of this inner DIV just get colored when the outer DIV has borders. In the example on the URL "http://www.libelle.at/kraftb/moz_bug.html" you can see it. If you look at the source you see the "border-top" of the outer DIV is commented out. If you comment it in the margin of the inner DIVs will also get colored blue.
Assignee: firefox → nobody
Component: General → Layout
Product: Firefox → Core
QA Contact: firefox.general → core.layout
Version: 1.0 Branch → Trunk
Attached file text with padding
I think this is correctly rendered according to the recommedations of http://www.w3.org/TR/REC-CSS2/box.html The effect is caused by collapsing margins. See bug 275388. Using padding rather than margin as in the attachment should achieve the effect you want. (I.E. gives the same result with your original example, but is arguably wrong in this case)
"... adjoining margins (no non-empty content, padding or border areas or clearance separate them) of two or more boxes (which may be next to one another or nested) combine to form a single margin." http://www.w3.org/TR/CSS21/box.html#collapsing-margins -> INVALID
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
*** Bug 307016 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: