Beginner · Forms, semantic HTML and accessibility · topic 12 of 64 · 20 min
Semantic HTML
Explanation
What "semantic" means
Semantic means "about meaning". A semantic tag tells the browser what the content is, not how it looks. <nav> says "these are the main links", while <div> says nothing at all.
The main landmark tags
| Tag | Meaning |
|---|---|
| <header> | The top of the page or of a section: logo, title, maybe search |
| <nav> | A block of main navigation links |
| <main> | The main content of this page (only one per page) |
| <section> | A group of related content with its own heading |
| <article> | Something that makes sense on its own: a news story, a product, a comment |
| <aside> | Side content: related links, an advert, a tip box |
| <footer> | The bottom: contact, copyright, small links |
<body>
<header>
<h1>City News</h1>
<nav>
<a href="/">Home</a> <a href="/sports">Sports</a>
</nav>
</header>
<main>
<article>
<h2>Metro line opens</h2>
<p>Published <time datetime="2026-03-14">14 March 2026</time></p>
<p>The new line connects ...</p>
</article>
<aside>
<h2>Related stories</h2>
</aside>
</main>
<footer>
<p>Contact: news@example.com</p>
</footer>
</body>Who benefits
- Screen reader users can jump straight to <main> or <nav> with one key.
- Search engines understand which text is the main content.
- Developers reading your code see the structure at a glance.
- Browser reading modes can show the article cleanly.
Small semantic tags
<time datetime="2026-03-14"> gives a machine-readable date. <address> holds contact details. <mark> highlights a matching word. <button> is a real button, while a <div> that looks like a button is not.
Watch the lesson
Semantic HTML · 1/6
Semantic tags describe what a part of the page is, not how it looks.
Prefer a video by a teacher? Find free videos on “semantic html5 tags explained header nav main footer” on YouTube ↗
In real life: An exam results website
A board results site has a <header> with the logo, a <nav> with links to results, notices and contact, a <main> holding the result search form, an <aside> with helpline numbers, and a <footer>. A blind student using a screen reader presses one key to jump to the main landmark and finds the roll number field at once.
Practice (0/2 done)
Rewrite this page with semantic tags: the top part with the site name and links becomes <header> containing a <nav>, the main content goes in <main>, and the bottom becomes <footer>. There must be exactly one <main>.
Write a blog post page: a <main> with an <article> that has an <h2> title, a <time> element with a datetime attribute like "2026-05-01", and at least one paragraph.
Quick quiz
Read more (free)
Pass the quiz (60% or more) or mark this topic as done when you are ready.
Your progress is saved on this device only.