Closed
Bug 175738
Opened 23 years ago
Closed 23 years ago
Parts of a <div> background image isn't drawn in the margin areas of its first block element
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: pascalc, Assigned: dbaron)
Details
Attachments
(1 file)
|
774 bytes,
text/html
|
Details |
Build 2002101808 WinXP
Steps to reproduce the bug :
1 create a div with a background image and a block element such as a paragraph
or a header :
<div style="position:relative; background:
url(http://bugzilla.mozilla.org/ant.jpg)">
<h1 style="color:red;">text</h1>
</div>
2 create a second div surronded by a border with a background image and a block
element such as a paragraph or a header :
<div style="position:relative; background:
url(http://bugzilla.mozilla.org/ant.jpg)">
<h1 style="color:red;">text</h1>
</div>
expected result :
-apart from the border, the two divs should identical
actual result : a large part of the background image isn't drawn in the first
div, it seems to follow somewhat the top and bottom padding values of <H1>
I will attach a testcase
| Reporter | ||
Comment 1•23 years ago
|
||
| Assignee | ||
Comment 2•23 years ago
|
||
Our behavior here is correct. (Retitling bug to refer to padding rather than
margin, since it makes a big difference.) The relevant statement in CSS2 that
explain that this behavior is correct are:
http://www.w3.org/TR/CSS2/box.html#collapsing-margins
(note that the "and relatively" is an error and should be removed in the
next draft [W3C internal reference on this change:
http://lists.w3.org/Archives/Member/w3c-css-wg/2002JulSep/0292.html ])
"Two or more adjoining vertical margins of block boxes in the normal
flow collapse."
http://www.w3.org/TR/CSS2/visudet.html#q17
"If it has block-level children, it is the distance from the top
border-edge of the topmost block-level child box, to the bottom
border-edge of the bottommost block-level child box."
(There's also a bit of an error here, since it doesn't account for
cases where there is padding/border on the outer block.)
In other words, all adjacent vertical margins collapse, and when parent/child
margins collapse, the margin ends up outside the parent.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
Summary: Parts of a <div> background image isn't drawn in the padding areas of its first block element → Parts of a <div> background image isn't drawn in the margin areas of its first block element
| Assignee | ||
Comment 3•23 years ago
|
||
Actually, 10.6.3 is already corrected in CSS 2.1 drafts:
http://www.w3.org/TR/CSS21/visudet.html#q17
You need to log in
before you can comment on or make changes to this bug.
Description
•