Closed Bug 22816 Opened 26 years ago Closed 26 years ago

{css1} text-align: center doesn't center blocks

Categories

(Core :: CSS Parsing and Computation, defect, P3)

x86
Windows 98
defect

Tracking

()

VERIFIED INVALID

People

(Reporter: martin.honnen, Assigned: pierre)

References

Details

(Keywords: css1)

Attachments

(1 file)

I am trying to center a DIV with width less than 100%. While both of the below inner DIVs are centered with IE5 M12 left aligns them <STYLE> .centered { text-align: center; } .div80 { width: 80%; color: rgb(255,0,0); background-color: rgb(0,0,0); } </STYLE> </HEAD> <BODY> <DIV CLASS="centered"> <DIV CLASS="div80"> Kibology </DIV> </DIV> <BR> <CENTER> <DIV CLASS="div80"> Kibology </DIV> </CENTER>
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → INVALID
Summary: <DIV STYLE="text-align: center"><DIV STYLE="width: 80%;" doesn't center → {css1} text-align: center doesn't center blocks
IE is wrong. To center a block you should use auto margins. The 'text-align' property only applies to the alignment of text. See section 10.3.3 of CSS2: http://www.w3.org/TR/REC-CSS2/ Marking INVALID.
Is it right then that Mozilla centers <CENTER> <DIV> Kibology for all. </DIV> </CENTER> ??
<CENTER> is equivalent to <DIV ALIGN="CENTER"> which is equivalent to <DIV style="text-align:center">. The 'text-align' property is inherited. So the snippet: <CENTER> <DIV> Kibology for all. </DIV> </CENTER> ...should result in the _text_ being centered. It does. So yes, that is correct. This can be seen in the third example of the attached test case. Is this what you meant?
Keywords: css1
Migrating from {css1} to css1 keyword. The {css1}, {css2}, {css3} and {css-moz} radars should now be considered deprecated in favour of keywords. I am *really* sorry about the spam...
Status: RESOLVED → VERIFIED
Verified invalid
*** Bug 87562 has been marked as a duplicate of this bug. ***
*** Bug 237201 has been marked as a duplicate of this bug. ***
*** Bug 237299 has been marked as a duplicate of this bug. ***
*** Bug 293599 has been marked as a duplicate of this bug. ***
Hi! From CSS1, both: text-align: center and: <div align=center> must align everything to center. Both a text paragraph or a table. This is the normal behavior since Netscape 3.0 (around 1996). See this test case: http://www.hyperpublish.com/firedivbug/ our web software products use this kind of coding since 1996 and has proven to work on all Netscape, IE and Opera. You will find millions of web pages that does center things this way - maybe it's not 100% formally correct but's "de facto" and it is not incorrect. See the test case where it is specified double to center. Tell me a valid common sense reason to not center (as all the other browsers do center).
Netscape 3.0 didn't support CSS. Sure, it's the normal behavior for the latter, but not for the former.
*** Bug 333946 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.

Attachment

General

Creator:
Created:
Updated:
Size: