Python Headings (h1 to h6)
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.
"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.
Core Rules to Remember



Common Beginner Traps & How to Fix Them
Using h1-h6 just to make text bigger or smallerWhy 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.
Live Interactive Example
Hit Run Code to see it liveYour Turn: Micro Challenge
No pressure! Edit the starter code below and test your solution with instant feedback.
Create an h1 and h2 hierarchy
Create an <h1> heading with text "Portfolio"
Below it, create an <h2> heading with text "Recent Projects"
Finished reading and practicing?
Mark this lesson as completed to update your course progress.