Closed
Bug 178529
Opened 22 years ago
Closed 22 years ago
if you use a div with width:100% and margin-left inside a TD, it overflow to the right
Categories
(Core :: Layout: Tables, defect)
Core
Layout: Tables
Tracking
()
RESOLVED
INVALID
People
(Reporter: oliver, Unassigned)
Details
Attachments
(3 files, 1 obsolete file)
If you use a div with:
<div style="margin-left: 30px; width:100%" />
inside a TD like this:
<td> <div style="margin-left: 30px; width:100%" /> </td>
the div get outside the TD in the right side.
If you use width: auto; it works fine.
![]() |
||
Comment 1•22 years ago
|
||
So.. the big question is what the correct layout is....
Assignee: asa → table
Status: UNCONFIRMED → NEW
Component: Browser-General → Layout: Tables
Ever confirmed: true
OS: Windows XP → All
QA Contact: asa → amar
Hardware: PC → All
Summary: CSS: if you use a div with width:100% and margin-left inside a TD, it overflow to the right → if you use a div with width:100% and margin-left inside a TD, it overflow to the right
Since this can't be solved using the equation I described in bug ????? in a way
that yields a width smaller than the containing block width (or, for that
matter, at all), we should compute minimum and preferred width as though the
width were auto.
Reporter | ||
Comment 3•22 years ago
|
||
Test case for the bug, look this file in Mozilla 1.2b and IE6.0
Some of us don't have IE6. Could you attach a screenshot or describe the
difference in behavior?
Reporter | ||
Comment 5•22 years ago
|
||
in IE6.0 SP1
Reporter | ||
Comment 6•22 years ago
|
||
test case in Mozilla 1.2b WinXP (BuildID 2002101612)
Does that DOCTYPE declaration trigger IE6's strict mode, or is IE6 still
implementing width incorrectly in that example?
Reporter | ||
Comment 8•22 years ago
|
||
Comment #7:
don't know if IE is in strict mode.
I deleted the DOCTYPE from the testcase and in IE it looks the same as with DOCTYPE.
Reporter | ||
Comment 9•22 years ago
|
||
2nd test case, this looks better and has a new test. Will post a new screnshot
of IE, just because is funny what IE does in the new test :-)
Attachment #105238 -
Attachment is obsolete: true
![]() |
||
Comment 10•22 years ago
|
||
You have to use a 4.01 Strict doctype to get standards mode out of IE (to test,
type:
javascript:alert(document.compatMode)
in the url bar -- if it does not say "CSS1Compat" then IE is not in standards mode).
Reporter | ||
Comment 11•22 years ago
|
||
With
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
IE works just like Mozilla. So maybe it is something wrong in the CSS specs or
in my html. :-)
Reporter | ||
Comment 12•22 years ago
|
||
comment #11
Correct, I used this DOCTYPE:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
The problem is that width:100% and width:auto mean different things. width:100%
says that the width inside the padding should be the same size as the width
inside the padding of the parent. This doesn't leave room for the padding,
borders, and margins.
Resolving as invalid, since Mozilla's behavior is correct.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•