Closed Bug 134518 Opened 24 years ago Closed 24 years ago

Incorrectly calculated value for margin-bottom (in conjunction with position: fixed?)

Categories

(Core :: Layout, defect, P2)

defect

Tracking

()

RESOLVED DUPLICATE of bug 126213
Future

People

(Reporter: mozilla, Assigned: attinasi)

References

()

Details

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.9+) Gecko/20020330 BuildID: 2002033009 In some cases, the value calculated for margin-bottom is not correct. Look at the URL to see this problem: the left <div> (named 'foo') with a CSS 'height' value is correctly displayed, the right <div> (named 'bar') without a given 'height' has a wrong bottom margin. It seems as mozilla calculates the margin-bottom as follows: margin-bottom = margin-bottom + padding-top + padding-bottom + border-top + border-bottom (Maybe mozilla adds additional values which I have not tested.) Reproducible: Always Steps to Reproduce: You can use the example in the URL to do some testing. Changing the CSS values for padding or border also changes the bottom margin of the right <div>.
What do you mean by "bottom margin of the right div"? Do you mean "the location of the outer edge of the bottom border of the right div"? If so, the padding and border widths _should_ affect the location of that border edge (see http://www.w3.org/TR/REC-CSS2/box.html#box-dimensions and note that "height" specifies the height of the content area only, from inner padding edge to inner padding edge)
The "bottom margin" of an element is the space below that element, which can be influenced by setting the 'margin-bottom' CSS property. I set the offset from the bottom margin's edge to the bottom of the viewport to 0 for both <div>'s (see "bottom: 0px;" in the source). The width of all four margins should be 0 if I don't specify otherwise. But if I don't set a height for the element, as in the left <div>, mozilla will add a margin at the bottom, as happened with the right <div>, which is wrong. Even if I explicitly set "margin-bottom: 0px;" for the right <div>, this element will not be displayed without a gap to the viewport bottom edge.
Ah, I see what you mean. Confirming bug. This happens with absolutely positioned elements too...
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 2000 → All
Hardware: PC → All
Priority: -- → P2
Target Milestone: --- → Future
Changing QA contact
QA Contact: petersen → moied
this is almost certainly bug 126213
Depends on: 126213
This is fixed by the patch in bug 126213 *** This bug has been marked as a duplicate of 126213 ***
Status: NEW → RESOLVED
Closed: 24 years ago
No longer depends on: 126213
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.