HTML Headings

An explanation of HTML heading elements and how they define document structure.

On this page

HTML Headings

HTML heading elements define the structure of a document by marking titles and sections.

HTML provides six heading levels, ordered by importance from h1 to h6.


Heading Levels

h1 is the most important heading.

h6 is the least important heading.

Heading levels describe hierarchy, not visual size.


<h1>Heading 1</h1>

<h2>Heading 2</h2>

<h3>Heading 3</h3>

<h4>Heading 4</h4>

<h5>Heading 5</h5>

<h6>Heading 6</h6>


Basic Usage

Use headings based on document structure, not appearance.


<h1>Heading 1</h1>

<h2>Heading 2</h2>

<h3>Heading 3</h3>

<h4>Heading 4</h4>

<h5>Heading 5</h5>

<h6>Heading 6</h6>


Page Structure

Use one h1 for the main title. Use h2 for sections and h3 for subsections.


Example Structure


<h1>Travel Guide</h1>


<h2>Europe</h2>

<h3>France</h3>

<h3>Italy</h3>


<h2>Asia</h2>

<h3>India</h3>

<h3>Thailand</h3>


Notes

Browsers apply default styles to headings. Use CSS to change size or spacing while keeping the correct heading level.


<h1 class="large-heading">Large Heading</h1>


HTML Headings Examples (6)