If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Divs set to % does not hold when padding is placed on the div.

VERIFIED INVALID

Status

()

Core
Layout
P3
normal
VERIFIED INVALID
17 years ago
11 years ago

People

(Reporter: Kevin Idzi, Assigned: clayton)

Tracking

({compat})

Trunk
x86
Windows 2000
compat
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
BuildID:    2000082408

I have a div at 80% which displays properly.  When I add padding (which should 
be inside the div), the 80% is not held and the box grows larger than expected.	
					

Reproducible: Always
Steps to Reproduce:
Run the html in the additional info section.					

Actual Results:  Example shows with middle div extended too far.

Expected Results:  As netscape 4 and IE4/5 display - where the div is 80% but 
the padding sets the margin within the box.

<html>
	<HEAD>
	
	<STYLE>
	.BoxEdge
	{
		position: relative;
		background-color: #FFFFFF;
		width: 80%;
	}


	.Text
	{
		position: relative;
		background-color: #FFFFFF;
		padding-left: 1em;
		padding-right: 1em;
		width: 80%;
	
	}
	</STYLE>
	</HEAD>

<body bgcolor="#006699">

	<DIV CLASS="BoxEdge">
	test
	</DIV>

	<DIV class="Text">
	test
	</DIV>

	<DIV CLASS="BoxEdge">
	test
	</DIV>


 </body>
 </html>
What Mozilla is doing is correct as per the spec. This bug is invalid in terms of the strict 
layout mode.
http://www.w3.org/TR/REC-CSS2/box.html

However, I am confirming this bug and sending it over to layout for consideration whether 
a quirk should be implemented or whether a quirk would do more harm than good.

For the record, IE 5 for Mac handles the test case according to the spec in its standards 
mode. In its quirks mode IE 5 for Mac does the same thing as (according to the 
description of this bug) Nav 4.x and IE for Windows.
Assignee: jst → clayton
Status: UNCONFIRMED → NEW
Component: DOM Level 0 → Layout
Ever confirmed: true
Keywords: compat
QA Contact: desale → petersen
Summary: Divs set to % does not hold when padding is placed on the div. → Divs set to % does not hold when padding is placed on the div.
INVALID. We support 'box-sizing' (a CSS3 property) do to what you want.
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Keywords: verifyme
Resolution: --- → INVALID
*** Bug 53374 has been marked as a duplicate of this bug. ***

Comment 4

17 years ago
verified
Status: RESOLVED → VERIFIED
Keywords: verifyme

Comment 5

12 years ago
*** Bug 298332 has been marked as a duplicate of this bug. ***

Comment 6

12 years ago
This bug seems to appear again in DeerPark Alph 1

Comment 7

12 years ago
after reading http://www.w3.org/TR/REC-CSS2/box.html it seems like mozilla has a bug and don't display the DIVs correctly. for example: the content's width should be = (box's_width - padding). but we specify the box's width and padding... so we can change the content's width which is IN the box.

Comment 8

12 years ago
so how the f**k do I use box-sizing to make the stupid mozilla understand what i'm trying to do with my site using DIV tags?
*** Bug 342867 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.