Roadmap › HTML5 & CSS3 — Semantic Markup to Responsive Layouts › Module: HTML Foundations
Lessons in this course (11)
1. Document structure and semantic HTML
Basic★ Must knowLesson 1 of 11
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Orders — Divakar Shop</title>
<link rel="stylesheet" href="styles.css">
<script src="app.js" defer></script>
</head>
<body>
<header><nav aria-label="Main"><a href="/">Home</a> <a href="/orders">Orders</a></nav></header>
<main>
<article>
<h1>Order #1001</h1>
<section><h2>Items</h2> …</section>
</article>
<aside>Related offers</aside>
</main>
<footer>© 2026</footer>
</body>
</html>Why semantic tags matter: screen readers use them as landmarks, search engines understand the content, and code is easier to read. <div> and <span> have no meaning — use them only for styling hooks.
| Element | Meaning |
|---|---|
header / footer | Intro / closing content of a page or section |
nav | Major navigation links |
main | The unique main content (one per page) |
article | Self-contained content (post, product card) |
section | Thematic group with a heading |
aside | Related but secondary content |
h1–h6 | Heading hierarchy — don't skip levels for styling |
Block vs inline: block elements (div, p, h1, section) start on a new line and take full width; inline elements (span, a, strong) flow within text and ignore width/height; inline-block flows inline but accepts width/height.