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: Fri, 24 Mar 2000 11:45:41 -0600
To: html-tidy@w3.org
Cc: html-tidy@mail.com
Message-ID: <OFBEAC80D6.8E490DFA-ON86256878.0032C8C2@rfdinc.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>>
> given this HTML input:
>
> <h1>Heading 1 text</h1>> 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
example)
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).

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

CSS :
/* element h1 */
div p.heading {
  font-size:
  }
/* 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 Friday, 24 March 2000 13:14:54 GMT

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