Headings h1-h6 and Their Hierarchy
Use heading levels to create meaningful document structure.
The Six Heading Levels
HTML provides six heading elements from <h1> to <h6>:
- h1 — Main page title (most important)
- h2 — Major sections
- h3 — Subsections
- h4, h5, h6 — Deeper subsections (rarely needed)
They visually decrease in size, but size is controlled by CSS — not the number.
Semantic Hierarchy
Headings create a document outline — a table of contents for your page:
<h1>HTML Fundamentals</h1>
<h2>Document Structure</h2>
<h3>The html Element</h3>
<h3>The head Element</h3>
<h2>Text Elements</h2>
<h3>Headings</h3>
<h3>Paragraphs</h3>All lessons in this course
- Headings h1-h6 and Their Hierarchy
- Paragraphs em strong and b i
- br hr blockquote and pre
- The span and div Elements