HEADINGS7 min20 XP

Headings h1-h6

Learn Headings h1-h6 with live examples, interactive editor, and Shiv AI tutor.

HTML Headings — h1 to h6

HTML has 6 heading levels. They create a hierarchy of content like a newspaper: big headline, section titles, and sub-titles. Google uses headings heavily to understand your page and rank it in search.

All 6 Sizes in Action

Example 1 — All 6 Heading Levels
<h1>CIWeb — Learn HTML Free</h1>     <!-- Page title -->
<h2>HTML Course</h2>               <!-- Major section -->
<h3>Lesson 3: Headings</h3>      <!-- Sub-section -->
<h4>Level 4 Heading</h4>         <!-- Rarely used -->
<h5>Level 5 Heading</h5>         <!-- Very rare -->
<h6>Level 6 Heading</h6>         <!-- Smallest -->

CIWeb — Learn HTML Free

HTML Course

Lesson 3: Headings

Level 4 Heading

Level 5 Heading
Level 6 Heading
h1 is the largest and most important. h6 is the smallest. They create a visual and semantic hierarchy.

Blog Post Heading Structure

Example 2 — Real Blog Post Structure
<article>
  <h1>Python vs JavaScript in 2026</h1>
  <p>Both are great. Let me compare them...</p>

  <h2>Python Advantages</h2>
  <h3>Easy to Read</h3>
  <p>Python code reads like English...</p>
  <h3>Great for AI</h3>
  <p>TensorFlow, Pandas, NumPy...</p>

  <h2>JavaScript Advantages</h2>
  <h3>Runs in Browser</h3>
  <p>Only language browsers understand natively...</p>
</article>
Python vs JavaScript in 2026
Both are great. Let me compare them...
Python Advantages
Easy to Read — Python code reads like English...
Great for AI — TensorFlow, Pandas, NumPy...
JavaScript Advantages
Runs in Browser — Only language browsers understand...
Google reads this hierarchy to understand the article. h1=main topic, h2=major sections, h3=sub-topics. This is how you rank in search.
Heading Rules — Critical for SEO
One h1 per pageUse only ONE h1. It tells Google the main topic. Multiple h1 tags dilute your SEO ranking.
Do not skip levelsAfter h2 use h3, not h4. Skipping levels confuses screen readers and accessibility tools.
Keywords in headingsGoogle gives extra weight to text inside heading tags. Include your keywords naturally.
h4 to h6Rarely needed. Most real pages only use h1, h2, h3. Use deeper levels only for complex documents.
Headings = Direct SEO Impact

The words in your h1 are the strongest ranking signal on the page. A page with "Learn HTML Free" in its h1 will rank better for that search than a page without it. Followed by h2, then h3.

Why Only 6 Levels?

Tim Berners-Lee chose 6 heading levels in 1991 based on printed document hierarchy. Academic papers rarely go beyond 4-5 levels, so 6 was considered more than enough for any document.

CIWeb HTML Course • 22 Lessons • Free

Explain with Analogies

Shiv AI explains this lesson using real-life analogies — no code at all.

Click the Explain tab to generate analogies.
index.html
Live Preview
Write code then click Deep Analyze

How many h1 tags should a page have?

ExplanationA page should have exactly ONE h1 tag. It signals the main topic to Google. Multiple h1 tags confuse search engines and accessibility tools.
Build Challenge
Blog Post with Headings
Build a blog post using h1 for the title, h2 for major sections, h3 for sub-sections.
Requirements (5 to pass)
one h1
h2 used
h3 used
paragraph
DOCTYPE
solution.html
Preview
Community Wall
Lesson 3
0/500
0/20 lines
as
Recent Posts
Lesson 3 only
AI
Shiv AI
Online