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:
h1
Bold very large font, centered. One or two lines clear space between this and anything following. If printed on paper, start new page.
h2
Bold, large font, flush left against left margin, no indent.
One or two clear lines above and below.
h3
Italic, large font, slightly indented from the left margin. One or two clear lines above and below.
h4
Bold, normal font, indented more than
h3
. One clear line
above and below.
h5
Italic, normal font, indented as
h4
. One clear line above.
h6
Bold, indented same as normal text, more than
h5
. One
clear line above.
h1
to
h3
), it is discouraged.
Skipping header levels may produce strange
results when generating other
representations from HTML.
Parsers should not require any specific order to heading elements, even if the heading level increases by more than one between successive headings.