W3C home > Mailing lists > Public > html-tidy@w3.org > January to March 2000

RE: Complain on <center>

From: Jelks Cabaniss <jelks@jelks.nu>
Date: Thu, 30 Mar 2000 12:45:32 -0500 (EST)
To: <html-tidy@w3.org>
Message-ID: <NBBBICMNIPCICMKJECCBAEMMDHAA.jelks@jelks.nu>
Schweikert, Martin wrote:

> As far as I can see, <center></center> is not compliant to the
> standard. I know it is widely used, though.
>
> I would like it if tidy could complain on the use of <center> or even
> replace it:
>
> <h1 align="center">Heading</h1>

Actually, both the CENTER element and the ALIGN attribute are in HTML 4.0x and
XHTML 1.0 Transitional.  See the DTDs:

	http://www.w3.org/TR/html4/loose.dtd	and
	http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

The key word there is "Transitional".  In other words, if you declare your
document as one of the Transitional DTDs (HTML 4.01 or XHTML 1.0) with the
appropriate DOCTYPE declaration, you can use CENTER, ALIGN, FONT, U, etc., but
those *are* "Deprecated" -- meaning they won't be in future specifications.

Thus, replacing CENTER with H1 ALIGN="..." doesn't really gain you much.  A far
better solution is to use CSS, where you can declare:

	h1 { text-align: center; margin: auto; }

then down in your document:

	<h1>A heading</h1>

And then can use the Strict DTD instead of the Transitional, thus keeping you
more in line with the future than tied to the past.

Tidy is not yet DTD aware, as far as I know.

/Jelks
Received on Thursday, 30 March 2000 13:41:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:43 GMT