Chapter 6 — Semantic HTML & SEO
📚 Chapter Overview
A good website is not just for humans; it's for search engines and screen readers too. In this chapter, you will learn how to use Semantic tags to give meaning to your code and improve your site's SEO (Search Engine Optimization).
Learning Objectives:
- Understand the difference between Semantic and Non-semantic tags.
- Master
<header>,<nav>,<main>,<article>, and<footer>. - Use Metadata to improve SEO.
6.1 Semantic Tags
Part 1 — Definition
A semantic element clearly describes its meaning to both the browser and the developer. For example, a <div> tells the browser nothing about its content, but a <header> tells the browser exactly what it is. This is crucial for accessibility and search engine ranking.
Part 2 — Syntax
<header>...</header>
<nav>...</nav>
<main>
<section>...</section>
<article>...</article>
</main>
<footer>...</footer>
Part 3 — Example
Problem: Structure a blog post using semantic HTML.
<article>
<header>
<h1>The Future of AI</h1>
<p>Published on Aug 27, 2026</p>
</header>
<p>AI is changing the world...</p>
<footer>
<p>Written by John Doe</p>
</footer>
</article>
Part 4 — Video
Video: Coming Soon
6.2 SEO Basics with Meta Tags
Part 1 — Definition
Metadata is data about data. In HTML, <meta> tags are placed in the <head> section and are used to provide information about the page description, keywords, and author to search engines.
Part 2 — Syntax
<meta name="description" content="Learn HTML5 with Intelle Learn.">
<meta name="keywords" content="HTML, CSS, Web Development">
Part 3 — Example
Problem: Optimize a page for social sharing.
<meta property="og:title" content="My Portfolio">
<meta property="og:image" content="preview.jpg">
Observation: These are called Open Graph tags and are used by Facebook and LinkedIn to display rich links.
Part 4 — Video
Video: Coming Soon
🏆 Chapter Challenge
Challenge Objective
Refactor a plain "Div-soup" page into a Semantic masterwork.
Requirements
- Convert generic
divcontainers intoheader,nav,main, andfooter. - Add a
<meta>description tag to the head. - Use
<section>tags to separate different topics on the page.
Step-by-Step Process
- Analyze the existing structure.
- Replace IDs like
id="header"with the semantic<header>tag. - Ensure the
<main>tag contains the primary content.
Expected Deliverables
semantic_page.htmlsource file.