XHTML - The Heading Elements <h><h1><h2><h3><h4><h5><h6>

From the W3C - 8.5 The heading elements
From the W3C - 8.9 The section element

A heading element (<h>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>) briefly describes the topic of the section it introduces. Heading information may be used by user agents, for example, to construct a table of contents for a document automatically.

XHTML Heading Styles

There are two styles of headings in XHTML: the numbered versions h1, h2 etc., and the structured version h, which is used in combination with the section element.

There are six levels of numbered headings in XHTML with h1 as the most important and h6 as the least. The visual presentation of headers can render more important headings in larger fonts than less important ones.

Structured headings use the single h element, in combination with the section element to indicate the structure of the document, and the nesting of the sections indicates the importance of the heading. The heading for the section is the one that is a child of the section element.

<body>
<h>This is a top level heading</h>
<p>....</p>
<section>
    <p>....</p>
    <h>This is a second level heading</h>
    <p>....</p>
    <h>This is another second level heading</h>
    <p>....</p>
</section>
<section>
    <p>....</p>
    <h>This is another second level heading</h>
    <p>....</p>
    <section>
        <h>This is a third level heading</h>
        <p>....</p>
    </section>
</section>

Last modified: 2008-01-20T20:25:58-0800

Get Firefox

Google AdSense

SEO Consultants Directory