W3C home > Mailing lists > Public > html-tidy@w3.org > July to September 2001

Re: Clarification Requested: block tags vs. inline tags

From: J. David Bryan <jdbryan@acm.org>
Date: Thu, 5 Jul 2001 17:01:04 -0400
Message-Id: <200107052101.f65L16j24035@mail.bcpl.net>
To: HTML Tidy List <html-tidy@w3.org>
CC: tidy-develop@lists.sourceforge.net
On 5 Jul 2001, at 15:18, Reitzel, Charlie wrote:

> But, I agree w/ Steven, Tidy is generating essentially correct HTML. 

HTML Tidy is generating correct HTML but not optimal HTML.

Given incorrect HTML, my understanding is that Tidy should attempt to 
correct it in such a way as to reproduce (where possible) the behavior of 
the incorrect HTML on common browsers.  So given that the original 


is invalid (anchor elements cannot contain block elements, i.e., <a> cannot 
contain <center>), Tidy corrects this to:


where the <div>s plus CSS take the place of the <center>s.  This is 
correct, but a better translation, i.e., equally correct and closer to the 
original behavior, would be:


or specifically:

  <td width="150">
    <div class="c1">
      <a href="Kasse.htm">
        <img ...>

Note that the correction suggested by the original poster:


is invalid.

> Would <span> be ok?

<span> would be syntactically correct, as it is an inline element, but then 
the CSS would be invalid (the class="c1" that Tidy generates includes a 
"text-align" property, and "text-align" applies only to block elements).

                                      -- Dave
Received on Thursday, 5 July 2001 17:01:08 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:50 UTC