SA-21/06, C-11, Asapur, Varanasi, UP support@kamaldnp.com +91 8318013442
HTML
1. HTML Introduction: What is HTML? Learn with Examples 2. Best Free HTML Editors: Notepad to VS Code for Beginners 3. HTML Basic Structure: Doctype, Head, Body Explained 4. HTML Elements Explained: Tags, Content & Empty Elements 5. HTML Attributes List: href, src, alt, width, title & More 6. HTML Headings h1 to h6: Which Heading Tag to Use When 7. HTML Paragraphs: p Tag, br Line Breaks & pre Text 8. HTML Style Attribute: Colour, Font Size & Alignment 9. HTML Text Formatting Tags: bold, italic, mark & More 10. HTML Comments: How to Add Notes & Hide Code in HTML 11. HTML Colors: Names, HEX, RGB & HSL Colour Codes 12. HTML CSS: Inline, Internal & External Stylesheets 13. HTML Links: a Tag, href, New Tab & Email Links 14. HTML Images: img Tag, src, alt, Width & Formats 15. HTML Favicon: Create & Add a Browser Tab Icon 16. HTML Title Tag: How to Write a Good Page Title 17. HTML Tables: table, tr, th, td, colspan & rowspan 18. HTML Lists: ul, ol, dl & Nested Lists Explained 19. HTML Block vs Inline Elements: div, p, span Explained 20. HTML Div Tag: Group Content & Build Page Layouts 21. HTML Class Attribute: Style Many Elements at Once 22. HTML id Attribute: Unique IDs, Links, CSS & JavaScript 23. HTML Iframes: Embed YouTube, Maps & Pages in HTML 24. HTML JavaScript: script Tag, Clicks & First Example 25. HTML File Paths: Relative vs Absolute Paths Explained 26. HTML Head Element: title, meta, charset & viewport 27. HTML Layout: header, nav, main, footer Page Structure 28. HTML Responsive Design: Viewport, Images & Media Queries 29. Semantic HTML Tags: header, nav, main, article & footer 30. HTML Forms: input, label, select, checkbox & Submit 31. HTML Entities: & < > © with Examples 32. HTML Audio & Video Tags: controls, source & Fallback 33. HTML Accessibility: alt Text, Labels, Landmarks & ARIA 34. HTML Meta Tags & SEO: charset, viewport, OG Tags 35. HTML Quotations: blockquote, q, cite, abbr & address
Final Test — Certificate ₹10
Try this code live
Lesson 29 of 35

Semantic HTML Tags: header, nav, main, article & footer

4 min read · Free · No login needed

Semantic HTML means using tags that describe what the content is, not just how it looks. <article> means "this is a self-contained piece of writing". <nav> means "this is navigation". A <div> means nothing at all. Both can look identical on screen — but to Google and to screen readers, they are very different.

Diagram — see how it fits together
Infographic: semantic HTML tags

The main semantic tags

  • <header>, <footer> — top and bottom of a page or a section.
  • <nav> — navigation links.
  • <main> — the main content (one per page).
  • <article> — a blog post, a news story, a product card.
  • <section> — a themed group inside a page.
  • <aside> — side content related to the main content.
  • <figure> and <figcaption> — an image with its caption.
  • <time> — a date or time, in a format machines can read.

Why it matters

Search engines: Google uses semantic tags to understand your page. An article inside an <article> tag is more likely to appear in search results than the same text inside a pile of divs. Accessibility: a blind visitor using a screen reader can jump straight to the <nav> or the <main> content instead of listening to the whole page. Maintenance: six months later, <article> tells you what the code is; <div class="x"> does not.

Tip: A good test: if you remove all the CSS from your page, the structure should still make sense when read top to bottom. That is what semantic HTML gives you.

What "semantic" means

Semantic means "with meaning". A semantic tag tells the browser — and Google, and a screen reader — what its content is, not just how it looks. <article> says "this is a self-contained piece of writing". <nav> says "these are navigation links". A <div> says nothing at all. Same look on screen, completely different meaning underneath.

The main semantic tags

TagValueDescription
<header>—The top of a page or a section — logo, title, intro.
<nav>—A block of navigation links, usually the main menu.
<main>—The main content of the page. Only one per page.
<section>—A themed group of content, usually with its own heading.
<article>—A self-contained piece — a blog post, a news story, a product card.
<aside>—Side content — a sidebar, related links, an advertisement.
<figure> / <figcaption>—An image (or diagram) with its caption.
<footer>—The bottom of a page or a section — copyright, contact, links.

A blog post marked up semantically is easy to read — for people and for machines:

<article>
  <header><h2>My First Post</h2></header>
  <p>The post text goes here.</p>
  <footer>Posted on 28 October 2026</footer>
</article>
Note: A <section> should almost always have a heading. If you cannot write a heading for it, it is probably not a section — a plain <div> is likely the right tag.
Tip: Use <article> for anything that could stand alone — a blog post, a course card, a news item. If you can imagine it in an RSS feed on its own, it is an article.

Common mistakes

  • Using <div> for everything — header, nav, and footer exist for a reason.
  • Using two <main> elements — one page, one main.
  • Wrapping a single paragraph in a <section> — a section is a group of related content, not a wrapper for one line.
  • Putting the site menu in a div instead of <nav> — screen reader users then cannot jump to it.

Example explained

  • <header> — the top of the page, holding the site name. It says "this is the header", not just "this is a box".
  • <nav> — the menu. A screen reader can jump straight to it instead of reading the whole page.
  • <article> — the blog post. It is a self-contained piece of writing, so Google treats it as one unit.
  • <time datetime="2026-10-27">27 October 2026</time> — the date in a format machines can read, while visitors see the friendly text.
  • <footer> — the bottom of the page, with the copyright notice.

Example

Example
<!DOCTYPE html>
<html>
<head>
<title>Semantics</title>
</head>
<body>

<header><h1>KAMALDNP Blog</h1></header>
<nav><a href="#">Home</a> | <a href="#">Blog</a></nav>
<main>
<article>
<h2>How to Learn HTML</h2>
<p>Start with the basics, practise every day…</p>
<time datetime="2026-10-27">27 October 2026</time>
</article>
</main>
<footer><p>© 2026 KAMALDNP Academy</p></footer>

</body>
</html>

Output

Output — how it looks in the browser
Output of Semantic HTML Tags: header, nav, main, article & footer

Try it yourself — live editor

Change the code below and press Run to see the result instantly. No file to save, no login needed.

Result

Frequently asked questions

The questions learners ask most about this lesson — read the question, then open it to see the answer.

1. What does semantic HTML mean?

Using tags that describe what content is, not just how it looks, so Google and screen readers understand the page.

2. What is the difference between article and div?

Article means a self-contained piece of writing like a blog post, while div means nothing at all.

3. Why do semantic tags help blind visitors?

A screen reader user can jump straight to nav or main content instead of listening to the whole page.

Why learn this yourself — and not just ask AI?

AI can write code for you, but it cannot think for you. When you learn HTML yourself, your brain builds the real skill: you understand why a page looks the way it does, you can fix it when it breaks, and you can answer it in an exam or an interview without help. That is the skill that gets you a job — not a copied answer.

Get certified — just ₹10

Finish all 35 lessons, pass the test (80%), pay ₹10 and get your certificate.

Take the test

Prefer watching? Video courses teach the same topics step by step.

Go further with a full course

Free tutorials teach you the basics. Our paid courses add live projects, mentorship and a certificate.

Full Stack PHP Development Course 2026
₹3,000
View
WordPress Website Development Course (10 Days)
₹399
View
AI Power Skills in 2 Days | Learn AI Text, Image, Video and Voice Tools
View
Browse all courses
HTML — Lessons
1. HTML Introduction: What is HTML? Learn with Examples 2. Best Free HTML Editors: Notepad to VS Code for Beginners 3. HTML Basic Structure: Doctype, Head, Body Explained 4. HTML Elements Explained: Tags, Content & Empty Elements 5. HTML Attributes List: href, src, alt, width, title & More 6. HTML Headings h1 to h6: Which Heading Tag to Use When 7. HTML Paragraphs: p Tag, br Line Breaks & pre Text 8. HTML Style Attribute: Colour, Font Size & Alignment 9. HTML Text Formatting Tags: bold, italic, mark & More 10. HTML Comments: How to Add Notes & Hide Code in HTML 11. HTML Colors: Names, HEX, RGB & HSL Colour Codes 12. HTML CSS: Inline, Internal & External Stylesheets 13. HTML Links: a Tag, href, New Tab & Email Links 14. HTML Images: img Tag, src, alt, Width & Formats 15. HTML Favicon: Create & Add a Browser Tab Icon 16. HTML Title Tag: How to Write a Good Page Title 17. HTML Tables: table, tr, th, td, colspan & rowspan 18. HTML Lists: ul, ol, dl & Nested Lists Explained 19. HTML Block vs Inline Elements: div, p, span Explained 20. HTML Div Tag: Group Content & Build Page Layouts 21. HTML Class Attribute: Style Many Elements at Once 22. HTML id Attribute: Unique IDs, Links, CSS & JavaScript 23. HTML Iframes: Embed YouTube, Maps & Pages in HTML 24. HTML JavaScript: script Tag, Clicks & First Example 25. HTML File Paths: Relative vs Absolute Paths Explained 26. HTML Head Element: title, meta, charset & viewport 27. HTML Layout: header, nav, main, footer Page Structure 28. HTML Responsive Design: Viewport, Images & Media Queries 29. Semantic HTML Tags: header, nav, main, article & footer 30. HTML Forms: input, label, select, checkbox & Submit 31. HTML Entities: & < > © with Examples 32. HTML Audio & Video Tags: controls, source & Fallback 33. HTML Accessibility: alt Text, Labels, Landmarks & ARIA 34. HTML Meta Tags & SEO: charset, viewport, OG Tags 35. HTML Quotations: blockquote, q, cite, abbr & address
Final Test — Certificate ₹10

🤖 KAMALDNP AI Assistant

Ask about courses, website & more

Hi! I'm KAMALDNP AI Assistant. Ask me about our courses, website features, or anything else! 😊
Please wait 5s...
🤖 KAMALDNP Assistant ✕

Request human callback:

🔐 Login Required
✕

Please log in to download. You will stay on this page after logging in!

New here? Register now →