The div element is a generic container with no meaning of its own β until you give it one.
<div> elements (no <header>, <main>, etc. β weβll add those later)idclass β no styling needed, just structureEvery previous lesson introduced elements with built-in meaning:
<h1> is a heading β browsers display it large and bold<p> is a paragraph<a> is a link<img> is an imageThese are semantic elements β the browser and screen readers understand what they are without explanation.
<div> is different:
<!-- A div alone does nothing visible -->
<div></div>
<!-- A div with a class becomes a named structure -->
<div class="site-header">
<a href="/" class="site-logo">Studio Name</a>
<nav class="site-nav">
<a href="/work">Work</a>
<a href="/about">About</a>
</nav>
</div>
<div> for Layout<div> is the fundamental grouping tool for visual structure<header>, <main>, <aside>, <footer>) are preferred for major landmarks β but <div> is still essential inside those regionsA basic page layout built from <div> elements:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Home β Maya Chen Design</title>
</head>
<body>
<div id="page-header" class="page-region">
<div class="header-inner">
<span class="site-name">Maya Chen Design</span>
<div id="main-nav" class="nav-links">
<a href="/">Home</a>
<a href="/work">Work</a>
<a href="/contact">Contact</a>
</div>
</div>
</div>
<div id="page-hero" class="page-region hero">
<h1>Visual Design & Brand Strategy</h1>
<p>I help small companies communicate with clarity.</p>
</div>
<div id="page-content" class="page-region">
<div class="project-grid">
<div class="project-card">
<h2>Saltline Coffee</h2>
<p>Brand identity and packaging system.</p>
</div>
<div class="project-card">
<h2>Vessel Architecture</h2>
<p>Website redesign and visual language.</p>
</div>
</div>
</div>
<div id="page-footer" class="page-region">
<p>© 2026 Maya Chen. All rights reserved.</p>
</div>
</body>
</html>
id (unique landmark) and a class (shared styles)<div><div> does the job β but HTML5 introduced elements that carry meaning on their own:
| Instead of | Use | Why |
|---|---|---|
<div id="header"> | <header> | Screen readers recognize it as the page header |
<div id="main-nav"> | <nav> | Identified as navigation for keyboard users |
<div id="page-content"> | <main> | Marks the primary content region |
<div id="sidebar"> | <aside> | Secondary content, related to the main |
<div id="footer"> | <footer> | Page or section footer |
<div> elements with built-in roles<div> first helps you see why those semantic elements exist