Closed
Bug 147848
Opened 23 years ago
Closed 23 years ago
CSS width attribute is broken when paddings are used
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: tvv, Assigned: attinasi)
References
Details
Attachments
(1 file)
575 bytes,
text/html
|
Details |
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
Reporter | ||
Comment 1•23 years ago
|
||
The navy boxes in this testcase have the same width declared in css, but look
different
Reporter | ||
Comment 2•23 years ago
|
||
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
Reporter | ||
Comment 3•23 years ago
|
||
My previous comment refers to attachment #85430 [details]
Comment 4•23 years ago
|
||
*** Bug 147847 has been marked as a duplicate of this bug. ***
Comment 5•23 years ago
|
||
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.
![]() |
||
Comment 6•23 years ago
|
||
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.
Description
•