W3C home > Mailing lists > Public > html-tidy@w3.org > October to December 2006

Re: Tidy strips <center> tags within <p> tags

From: Fred Bone <Fred.Bone@dial.pipex.com>
Date: Mon, 02 Oct 2006 08:50:08 +0100
To: html-tidy@w3.org
Message-ID: <4520D2C0.6523.31691E5@Fred.Bone.dial.pipex.com>

On 2 Oct 2006 at 11:52, Richard A. O'Keefe said:

> 
> Cory Nelson (hope I've got that right) wrote:
>     vvvvvvvvvv
>  > <center> is not valid within <p>.
>            ^^^^^^^^^^
> 
> "Fred Bone" <Fred.Bone@dial.pipex.com> replied:
>  <center> *is* valid for (X)HTML Transitional, ...
> 
> Valid, yes.  But not valid within <p>.
> <p> may only contain %inline content,
> and <center> is %block level content, NOT %inline content.

I suppose it depends on your (or Tidy's) interpretation of "within".
In my view, what
 <p>aaaa<center>bbbb</center>cccc</p>
really means is
 <p>aaaa</p><center>bbbb</center><p>cccc</p>
and I would expect Tidy to change it to that (or something close), rather 
than to
 <p>aaaa bbbb cccc</p>
which is what it seems to do with the equivalent(*) <div align="center">

Provided, of course, that you haven't told it the input is (X)HTML 
Strict, in which context <center> has no meaning at all.

(*) The HTML4x specs describe <center> as "shorthand for DIV 
align=center"
Received on Monday, 2 October 2006 08:01:22 GMT

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