HTML reference

h1 to h6

Heading elements describe the structure of a page. Use <h1> for the page's main topic, then use <h2> and deeper levels for nested sections.

What you will learn

  • What each heading level represents
  • How to create a logical hierarchy
  • How headings help scanning and assistive technology

Basic example

<h1>HTML forms</h1>
<h2>Text fields</h2>
<h3>Placeholder text</h3>
<h2>Buttons</h2>

The number expresses nesting, not visual size. CSS controls appearance, so do not choose a heading level only because it looks large.

Practical rules

Related pages