Closed
Bug 270355
Opened 20 years ago
Closed 20 years ago
CSS text-align on BODY not honoured by inner-elements
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: djr667, Assigned: bugzilla)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
BODY style='text-align: center' is honoured by inner text but not inner elements.
In fact I notice that text-align: center appears not to be honoured at all on
elements (only on inner text) - is this intentional?
My reading of the W3C CSS spec is that this behaviour is wrong.
Reproducible: Always
Steps to Reproduce:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
</head>
<!-- Center entire contents of page -->
<body style='text-align: center;'>
Some sample text
<table>
<caption>Table Centered in IE, Left aligned in Firefox</caption>
<tr>
<td>Cell 1</td><td>Cell 2</td>
</tr>
</table>
<!--
To quote part the W3C spec for 5.4.6 'text-align'
Example:
DIV.center { text-align: center }
Since 'text-align' inherits, all block-level elements inside the 'DIV'
element with
'CLASS=center' will be centered. Note that alignments are relative to the
width of the element,
not the canvas.
Since the 'Some sample text' is centered across the page (in both browsers) the
width of the BODY tag
must be the window or canvas width, which means the table should also be
centered and not left aligned.
-->
</body>
Comment 1•20 years ago
|
||
The w3c specs say: "This property describes how inline content of a block is aligned." http://www.w3.org/TR/1998/REC-CSS2-19980512/text.html#alignment-prop To center an element use auto margins, see this url for a crossbrowser solution: http://bluerobot.com/web/css/center1.html So Mozilla is doing the correct thing here, and IE not.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•