Closed Bug 147848 Opened 23 years ago Closed 23 years ago

CSS width attribute is broken when paddings are used

Categories

(Core :: Layout, defect)

All
Other
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: tvv, Assigned: attinasi)

References

Details

Attachments

(1 file)

Mozilla adds paddings to the resulting width of a block element, instead of subtracting them from the width of its contents. See attachment for a small testcase. Observed on Windows as well
Attached file A small testcase
The navy boxes in this testcase have the same width declared in css, but look different
Workaround (as shown in attachment #1 [details] [diff] [review]): apply margin attributes to all elements contained in the block, instead of applying paddings to the block
My previous comment refers to attachment #85430 [details]
*** Bug 147847 has been marked as a duplicate of this bug. ***
Mozilla's behaviour is correct here; subtracting the width is a known bug in earlier versions of IE. Searching the net for "box model hack" or "CSS Enhancements in Internet Explorer 6" will find you some references. INVALID.
see http://www.w3.org/TR/REC-CSS2/box.html#box-dimensions and http://www.w3.org/TR/REC-CSS2/visudet.html#the-width-property -- "width" is the content width and does not include padding. We render this correctly, as does every browser except IE 5/5.5 on Windows...
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: