Headings

HTML Headings

Example

HTML has six levels of headings, from <h1> (most important) to <h6> (least important):

<!DOCTYPE html>
<html>
<head>
  <title>Page Title</title>
</head>
<body>

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>

</body>
</html>

Result

Headings Are Important

  • Search engines use headings to understand the structure and topics of your page.
  • Screen-reader users jump between headings to skim a page, just like sighted users do.
  • Use one <h1> per page for the main title, then <h2> for sections, <h3> for sub-sections, without skipping levels.

Note: Use headings for structure, not to make text big or bold. For size, use CSS.