Closed Bug 451149 Opened 16 years ago Closed 16 years ago

quirks mode block centering with text-align:center off by left margin width

Categories

(Core :: Layout: Block and Inline, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 444015

People

(Reporter: bugzzilla, Unassigned)

References

Details

(Keywords: regression, testcase)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1

When a DIV is assigned a width and margin with CSS and appears inside a centered section, it is not actually centered. It is centered when the margin attribute is removed.

Reproducible: Always

Steps to Reproduce:
1. Create HTML content:

<html>
<head>
<style type="text/css">
BODY {background: #d4d4c5; margin: 0px; }
DIV.div1 { width: 20em; background: gray;
            text-align: center; }
DIV.div2 { width: 20em; background: gray;
            margin: 2em;
            text-align: center; }
</style>
</head>
<body>
<center style="background: white;">
<div class=div1>
This is DIV 1
</div>
<div class=div2>
This is DIV 2
</div>
</center>
<body>
</html>

2. Load in Firefox
3. Observe position of DIV 2 compared to DIV 1.
Actual Results:  
DIV 2 is not centered even when window is wide enough. It is moved to the left.

Expected Results:  
DIV 1 and DIV 2 should both be centered as long as window is wide enough.
Summary: DIV with CSS width and margin in not centered → DIV with CSS width and margin is not centered
This is caused by bug 300030.
Component: General → Layout: Tables
Keywords: regression, testcase
Product: Firefox → Core
QA Contact: general → layout.tables
Version: unspecified → Trunk
Component: Layout: Tables → Layout: Block and Inline
QA Contact: layout.tables → layout.block-and-inline
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking1.9.1?
Summary: DIV with CSS width and margin is not centered → quirks mode block centering with text-align:center off by left margin width
This reminds me of bug 444015.
this is wfm with current trunk isn't this a dupe of bug 444015
WFM also.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → WORKSFORME
I'm pretty sure this was fixed by...
Resolution: WORKSFORME → DUPLICATE
Flags: blocking1.9.1? → wanted1.9.1+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: