HTML Headings
You can already write elements and attributes. This session focuses on headings — the tags that label the main title and section titles of a page. Good headings help readers scan a page and help browsers and assistive tools understand the outline.
What are HTML headings?
HTML headings are six levels of title elements: h1, h2, h3, h4, h5, and h6. h1 is the highest-level heading on the page. h6 is the lowest. These tags are for meaning and structure. Visual size can be changed later with CSS; do not pick a heading level only because you want bigger or smaller text.
Direct answer
Use headings to build a clear outline. Prefer one main h1 for the page topic. Use h2 for major sections under that topic, then h3 for subsections, and so on. Keep levels in order when you can — jumping from h1 straight to h4 usually makes the outline harder to follow.
Heading levels
html<h1>Main Page Title</h1>
<h2>Section Title</h2>
<h3>Subsection Title</h3>
<p>Paragraph text under the subsection.</p>
Reading the example
h1introduces the whole page topich2starts a major section under that topich3starts a smaller part inside that section- The paragraph is normal body text, not a heading
Why heading order matters
Headings create a document outline, similar to a table of contents. Screen readers and some SEO tools use that outline. If you skip levels only for look-and-feel, the structure becomes confusing even if the page still “looks fine” to you.
One h1, then sections
For beginner pages in this course, keep a single clear h1. Then organize content with h2 and deeper levels as needed. You will meet more advanced outline patterns later; first master this simple, readable pattern.
A small page outline
html<h1>City Guide</h1>
<h2>Getting Around</h2>
<p>Tips for buses and trains.</p>
<h2>Food</h2>
<h3>Street Food</h3>
<p>Quick local snacks.</p>
<h3>Sit-down Restaurants</h3>
<p>Places for a longer meal.</p>
Headings are not for empty spacing
Do not use empty heading tags to create blank vertical space. Do not wrap every bold phrase in a heading. If text is not a real title for a section, use a paragraph or another suitable element instead.
Try it yourself
- Create or open an HTML file with the basic skeleton
- Add one
h1that names the page topic - Add two
h2sections with a short paragraph under each - Under one
h2, add anh3and a short paragraph - Save and open the page — check that the outline is easy to scan
Common mistakes
- Choosing heading levels only by font size instead of structure
- Skipping from
h1toh4without a reason - Using many
h1tags on a simple beginner page when one clear main title is enough - Putting long paragraphs inside heading tags
- Using headings as decorative spacers with no real section title
Summary
- Headings use
h1throughh6to mark title levels - They build structure and outline, not just visual size
- Prefer one clear
h1, then orderlyh2–h6sections - Avoid skipping levels only for styling
- Keep heading text short and title-like
- Style size with CSS later; keep HTML headings semantic
🧠 Test Your Knowledge
Test Your Knowledge
Challenge yourself with this interactive quiz and see how well you understand the topic
📝 Instructions
- Read each question carefully
- Select the best answer for each question
- You can retake the quiz as many times as you want
- Your progress will be shown at the top