SyntaxStudy
Sign Up
HTML Beginner 1 min read

HTML Headings

HTML Headings

HTML defines six levels of headings. They are used to create a logical document outline — like a table of contents.

Heading Hierarchy

  • <h1> — Page title (one per page)
  • <h2> — Major sections
  • <h3> — Subsections within h2
  • <h4><h6> — Deeper nesting (rarely needed)

Why Headings Matter

  • SEO — Search engines use headings to understand your content
  • Accessibility — Screen readers use them to navigate
  • Readability — They give visual structure to the page
Example
<h1>Main Page Title</h1>
<h2>Chapter 1: Introduction</h2>
<h3>What is HTML?</h3>
<p>Content here...</p>
<h3>Why Use HTML?</h3>
<p>Content here...</p>
<h2>Chapter 2: Elements</h2>