Headings create an outline readers can follow. h1 names the main topic, h2 begins a major part, and h3 introduces a smaller point within that part.
What You Need to Know
Choose a heading level because of its position in the story, not because you prefer its default font size. CSS handles appearance.
Example: See It in Action
Add this example to the appropriate part of a practice HTML page. Read each line before you open the page in your browser.
This is a short HTML fragment. To try it as a webpage, put it inside the body element of a complete HTML document.
<h1>The Solar System</h1>
<h2>Inner Planets</h2>
<h3>Mars</h3>
<p>Mars is sometimes called the red planet.</p>
Let’s Understand the Example
- An h1 introduces the main subject of the page. Use the heading level for structure rather than font size.
- An h2 starts a major section beneath the page topic.
- An h3 introduces a smaller topic inside the preceding section.
You should see a readable heading and its related content. The heading level tells readers how the ideas fit together, not merely how large the letters look.
What Should You See?
The page should display “The Solar System” as a heading, followed by its related content. Change the heading text and refresh the browser to see the result.
Read only the headings, from top to bottom. Do they tell a sensible story? If not, move sections or choose levels that match the content.
Try It Yourself
- Add an h3 under Inner Planets and check the hierarchy.
- Save your changes, open or refresh the page, and compare the result with the original example.
- Tell a friend what your change did. If you are not sure, undo it, refresh the page, and compare.
Common Beginner Mistakes
- Jumping from an h1 to h5 just to get small text.
- Avoid picking tags just for their default bold, italic or spaced appearance. Use CSS for presentation.
Key Takeaways
- Headings create an outline readers can follow. h1 names the main topic, h2 begins a major part, and h3 introduces a smaller point within that part.
- An h1 introduces the main subject of the page. Use the heading level for structure rather than font size.
- Choose a heading level because of its position in the story, not because you prefer its default font size. CSS handles appearance.