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

Re: HTML heading hierarchy for XHTML [RE-POST]

From: Jany Quintard <quintard.j@cgi.fr>
Date: Tue, 1 Feb 2000 10:12:55 +0100 (CET)
To: html-tidy@w3.org
cc: html-tidy@mail.com
Message-ID: <Pine.LNX.3.96.1000201091542.555j-100000@pc555zh74.adtools.fr.ibm.com>
On Mon, 31 Jan 2000, Marc Rubin, Jay's Island Software Development & Consulting wrote:

> I'd like to preserve the implicit hierarchy of HTML headings when converting to XHTML. For example, I'd like to end up with this XHTML output:
> <h1>Heading 1 text
>         <h2>Heading 2 under heading 1</h2>
> </h1>
> given this HTML input:
> <h1>Heading 1 text</h1>
>         <h2>Heading 2 under heading 1</h2>
> Would this translation be feasible as an option in Tidy?
Actually, this has nothing to do with Tidy but with the language.
heading elements are nothing but paragraph like elements with default
display options (sort of shortcuts) . They don't have nor implicit neither
explicit hierarchy. 
They could be replaced by something like
<p class="heading1">, the class being processed at display by CSS (for
So, you can't include a paragraph in a paragrah and you can't include a
header in a header.
Another way to solve this would be to use div elements and display header
in a
way according to the depth of the inclusion (using CSS).

  <p class="heading">Heading 1</p>
    <p class="heading">Heading 2/</p>

/* element h1 */
div p.heading {
/* element h2 */
div div p.heading {

/* element hn */
div div ... div p.heading {

The superiority of this is that the appearance of the header is not
hardcoded but "computed", and that if you move a division, there is no
need to recode the headers.

Hope this helps
Received on Tuesday, 1 February 2000 04:13:41 UTC

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