Closed Bug 106809 Opened 23 years ago Closed 23 years ago

Adds padding when calculating 100% width in DIV

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: simpson, Assigned: dbaron)

References

Details

From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2) Gecko/20010726 Netscape6/6.1 BuildID: 200101201 Setting the width css attribute for a DIV with padding will add in the value of the padding causing the DIV to wrap off the page. This may happen with the height too. I did not test. Reproducible: Always Steps to Reproduce: 1.Render code in Additional Comments. 2.Set the padding to 0px and reload page. 3. <html> <div style="background-color: #CCCCCC; padding: 10px; width: 100%"> hello! </div> </html>
This is the way the CSS box model works. (It should work this way in IE6 as well, I think -- they fixed their code.) See http://www.w3.org/TR/REC-CSS2/box.html . Marking invalid.
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
(And what you want is 'width: auto', not 'width: 100%'.)
You need to log in before you can comment on or make changes to this bug.