Coding/Learn/html/headings
HTML Beginner Course
01.Introduction to HTML
02.Anatomy of an HTML Element
03.The Sacred HTML5 Skeleton
04.Headings (h1 to h6)
05.Paragraphs, Line Breaks & Dividers
06.Text Formatting & Emphasis
07.Hyperlinks & Navigation (<a>)
08.Images & The Sacred Alt Text (<img>)
09.Ordered & Unordered Lists (<ul>, <ol>, <li>)
10.Block vs Inline Elements
11.Generic Containers (<div> & <span>)
12.Semantic HTML (<header>, <nav>, <main>, <footer>)
13.Tables (<table>, <tr>, <th>, <td>)
14.Native Audio & Video Elements
15.The Invisible Brain (<head> & Meta Tags)
16.Interactive Forms (<form>)
17.Input Types (<input>)
18.Accessible Labels & Submit Buttons
19.Textareas & Select Dropdowns (<textarea>, <select>)
20.Capstone: Building Your First Web Profile Page
Course Certificate0%

Complete all lessons to earn

LearnHeadings (h1 to h6)
4 / 20 0%
Lesson 04 of 20
4 mins read

Headings (h1 to h6)

PreviousNext Lesson
In Plain English

HTML provides 6 levels of headings: <h1> through <h6>. <h1> represents the main topic of the entire page, while <h6> is a tiny sub-heading. They are vital for both human readability and Google SEO search ranking.

The Mental Model

"Imagine a newspaper. <h1> is the giant front-page headline: "HUMANS LAND ON MARS". <h2> is a section title: "Rocket Details". <h3> is a subsection: "Fuel Tanks". You would never put five front-page headlines on one newspaper!"

Deep Dive: How It Works

Heading scale: <h1> is the largest and most important. <h6> is the smallest and least important.

SEO Golden Rule: Have exactly ONE <h1> per webpage representing the primary topic.

Never skip levels: Don't jump from <h1> straight to <h4> just because you want smaller text—use CSS for styling and HTML headings for semantic structure.

Syntax Blueprint

<h1>Main Title</h1>
<h2>Section Header</h2>
<h3>Subsection</h3>

Strict numerical order indicates depth in your document hierarchy.

PointCore Rules to Remember

Point star
One h1 Per Page: Tells search engines and screen readers what the page is about.
Point star
Semantic Hierarchy: Use headings to outline content logically like a book table of contents.
Point star
Block Elements: Headings automatically take up full available width and break onto new lines.

Common Beginner Traps & How to Fix Them

Mistake:Using h1-h6 just to make text bigger or smaller

Why it happens: Thinking headings are font-size presets rather than structural markers.

How to fix: Use headings for semantic structure and CSS font-size for purely visual styling.

Pro Tip: Screen readers used by visually impaired users often read just the headings first so users can quickly navigate to sections.

Live Interactive Example

Hit Run Code to see it live
Heading Hierarchy in Action
HTML5
1
2
3
4
Live Browser Preview
Click "Preview / Apply" to view the rendered output.
How it works: Each heading level establishes clear visual hierarchy and structure.

Your Turn: Micro Challenge

No pressure! Edit the starter code below and test your solution with instant feedback.

Micro Exercise

Create an h1 and h2 hierarchy

  • PointCreate an <h1> heading with text "Portfolio"
  • PointBelow it, create an <h2> heading with text "Recent Projects"
1
2
Browser Preview & Output
Click "Check HTML" to test your solution.

Finished reading and practicing?

Mark this lesson as completed to update your course progress.

PreviousNext Lesson
Overview100 SheetLearnCertificates