HTML Headings

Six levels of headings, h1 to h6.

✍️ 3 exercises + code challenge in this lesson

Headings are titles and subtitles on a page. HTML has six levels: <h1> is the most important and <h6> the least.

Why headings matter

  • Search engines use headings to understand what your page is about.
  • Screen-reader users jump between headings to navigate.
  • Readers skim headings to find what they need.
Use one <h1> per page and do not skip levels (h2 → h4). Use headings for structure, not just to make text big.

Key Takeaways: HTML Headings

Mastering HTML Headings helps you write clean and reliable HTML code. Follow standard conventions, test edge cases, and keep logic simple. Try running the code example below and complete the exercises to build confidence.

HTML Headings Code Example

HTML
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
Free sign-in required · Google login available

HTML Headings Practice Exercises

Check what you learned in “HTML Headings”.

/ 3 solved
Fill in the blank

Create the second most important heading.

<>Our Services</>
✓ Correct! Not quite. Try again.
Multiple choice

How many heading levels does HTML have?

✓ Correct! Not quite. Try again.
Code challenge

Add an <h1> "Menu" and below it an <h2> "Drinks".

Write the code in the live editor. Your answer is checked automatically.

Free sign-in required · Google login available

to save your exercise progress.
Finished this lesson?
Mark it complete to track your progress.

Stuck on something?

Ask the community in the CodesInTech forum.

Need a developer?

Learning on your own is great — and when you need professional help, our team builds custom software, websites and mobile apps for clients worldwide.

Explore Our Services