Level: 0

HTML defines six heading levels. A heading element implies all the font changes, paragraph breaks before and after, and white space necessary to render the heading. Further character emphasis or paragraph marks are not required in HTML headings.

The heading elements are <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, with <h1> being the highest level of heading. For example:

<h1>This is a heading</h1>

Here is some text
<h2>Second level heading</h2>
Here is some more text.

The style of each heading level is up to the designer of the presentation software. Since the rendering software is responsible for generating vertical white space between elements, do not follow a heading element with a paragraph tag.

A typical rendering for headings is:


Bold very large font, centered. One or two lines clear space between this and anything following. If printed on paper, start new page.


Bold, large font, flush left against left margin, no indent. One or two clear lines above and below.


Italic, large font, slightly indented from the left margin. One or two clear lines above and below.


Bold, normal font, indented more than h3. One clear line above and below.


Italic, normal font, indented as h4. One clear line above.


Bold, indented same as normal text, more than h5. One clear line above.

Although this is legal skip header levels (for example to go from h1 to h3), it is discouraged. Skipping header levels may produce strange results when generating other representations from HTML.

Parser Interaction with Headers

Parsers should not require any specific order to heading elements, even if the heading level increases by more than one between successive headings.

Preceding Section:
Following Section: Highlighting
Parent Section: Body
Contents of HyperText Markup Language