Name

h1, h2, h3, h4, h5, h6 — HTML 4.01 | HTML5

Synopsis

<hn > . . . </hn >

Specifies a heading that briefly describes the section it introduces. There are six levels of headings, from h1 (most important) to h6 (least important). HTML syntax requires that headings appear in order (for example, an h2 should not precede an h1) for proper document structure. Doing so not only improves accessibility but aids in search engine optimization (information in higher heading levels is given more weight).

Note

In HTML5, heading order can be repeated within sections of the same document, allowing greater flexibility with heading levels. This is to aid the outlining of documents and allows sections of a document to fall into the outline correctly no matter which document the section appears in.

Start/End Tags

Required/Required

Attributes

Core, Internationalization, Events, HTML5 Global Attributes

align="center|left|right"

Deprecated. Not in HTML5. Used to align the header left, right, or centered on the page.

Example

<h1>Story Title</h1>
<p>In the beginning . . .  </p>

<h2>Subsection Title</h2>
<p>And so on . . .  </p>
<p>And so on . . .  </p>

Get HTML & XHTML Pocket Reference, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.