Plate 1.5 · Phase 1 — Framing · 25 minutes
Semantic HTML: naming rooms, not just building them
You can build a whole page out of anonymous boxes, and it will look fine. This module is about the handful of elements that say what each region of a page is — the difference between amateur markup and professional markup, and one of the cheapest accessibility and search wins there is.
Warm-up · from Module 1.4A purely decorative swirl sits between two sections. What should its alt be?
alt="" — empty, so screen readers skip it. Leaving alt out entirely makes many of them read the filename aloud.
A floor plan with labels
Picture a realtor's floor plan for a Chicago apartment. Every room is labeled: Kitchen, Living room, Bedroom 1, Bath. Now picture the same plan with every room labeled Room. Same walls, same square footage — and suddenly useless to anyone trying to find the bathroom in the dark.
That's the difference between these two pages. They render identically.
Every room called "room"
<div class="top"> <div class="menu">…</div> </div> <div class="content"> <div class="post">…</div> </div> <div class="bottom">…</div>
Developers call this div soup. The class names are only hints to humans; to a browser and a screen reader, every one of these is just "a box".
Every room named
<header> <nav>…</nav> </header> <main> <article>…</article> </main> <footer>…</footer>
The same structure, now self-describing. Browsers, screen readers, search engines and the next developer all know which part is which.
Choose the element that says what the thing is.
A <main> is announced and can be jumped to; a <div class="content"> is just "a box". Reach for a div only when no element describes the job.
What a screen reader actually gets
Screen readers offer a list of landmarks — the named regions of a page — so users can jump straight to the navigation or the main content, the way you'd follow signs at O'Hare to Baggage Claim instead of walking every corridor. Semantic elements create those signs automatically. Switch between the two versions:
Landmarks list
The same page, built two ways, and the landmarks a screen reader can list for each.
Div soup:
<div class="top"> <div class="logo">Cedar & Pine</div> <div class="menu">...links...</div> </div> <div class="content"> <div class="post">...</div> <div class="sidebar">...</div> </div> <div class="bottom">...</div>
Semantic:
<header> <a href="/">Cedar & Pine</a> <nav aria-label="Main">...links...</nav> </header> <main> <article>...</article> <aside>...</aside> </main> <footer>...</footer>
| Div soup | Semantic |
|---|---|
| No landmarks found. | banner, navigation, main, complementary, contentinfo |
Notice that the div version makes a listener start at the top every time. The semantic version gives five signs for free, and one keystroke jumps to the content or the navigation.
The elements, and what each one means
| Element | Means | Typical content |
|---|---|---|
| <header> | Introductory content for the page (or for an article). | Logo, site name, the main navigation. |
| <nav> | A major block of navigation links. | The top menu, a table of contents. Not every group of links — just the important ones. |
| <main> | The page's primary content. Exactly one per page. | Everything that's unique to this page — not the header and footer repeated on every page. |
| <article> | A self-contained piece that would make sense on its own, anywhere. | A blog post, a news story, a product card, a review. Test: could it be emailed by itself? |
| <section> | A thematic group of content, with its own heading. | "Our story", "Opening hours", "Pricing". If it has no natural heading, it's probably not a section. (It only appears in a screen reader's landmark list if it has a name — for example aria-labelledby pointing at its heading.) |
| <aside> | Content related to the main content, but not part of its flow. | A sidebar, a pull quote, "related posts", a glossary box. |
| <footer> | Closing information for the page (or an article). | Copyright, contact details, secondary links, legal pages. |
| <address> | Contact information for the page's owner. | A mailing address, phone, email — inside the footer, usually. |
| <search> | A search or filter area. Newer (2023), now supported everywhere. | The site search box and its button. |
<div> (a block) and <span> (inline) mean nothing at all — and that's exactly their job. When you need a box purely to style or position something in Phase 2, and no element describes it, use them without guilt. The professional habit is simply the order of questions: first ask whether an element already means this; only then reach for a div.
article or section? The one people argue about
Ask one question: would this make sense if it were lifted out and published somewhere else on its own?
- A recipe for Philadelphia cheesesteak, with its title, ingredients and method — yes, it stands alone.
<article>. - The "Ingredients" part of that recipe — no, it only makes sense inside the recipe.
<section>.
Articles can contain sections, and sections can contain articles — a "Latest posts" section holding five article cards is completely normal.
The skeleton of nearly every website
<body>
<a class="skip" href="#main">Skip to main content</a>
<header>
<a href="index.html">Cedar & Pine Coffee</a>
<nav aria-label="Main">
<ul>…</ul>
</nav>
</header>
<main id="main">
<h1>Fresh roasted in Portland</h1>
<section> <h2>Our story</h2> … </section>
<section> <h2>Visit us</h2> … </section>
</main>
<footer>
<address>1200 NW Everett St, Portland, OR</address>
<p>© 2026 Cedar & Pine Coffee</p>
</footer>
</body>
Two details worth copying. The skip link at the very top lets keyboard users jump past the header straight to the content instead of tabbing through every menu item on every page — in Phase 2 you'll hide it until it receives focus. And aria-label="Main" names the nav, which matters when a page has more than one.
Which element is it?
Why it's worth the effort
- Accessibility: landmarks and skip links make a page navigable without sight or a mouse — in the US, inaccessible sites are a real source of lawsuits under the ADA.
- Search: clear structure helps search engines tell the page's real content from the menus and footers repeated everywhere — it can only help, never hurt.
- Browser features: reader modes (Safari Reader, Firefox Reader View) use these elements to find the real content.
- Your future self:
</main>tells you where you are in a 400-line file.</div>tells you nothing.
Three things beginners get wrong
1. Div soup. Every region a <div class="…">. It works, and it throws away everything this module describes.
2. More than one <main>. One page, one main — like one h1.
3. <section> as a styling wrapper. If it has no heading and no theme, it's a div.
Words you now own
- semantic element
- One whose name says what its content is.
- div soup
- A page built entirely from meaningless divs.
- landmark
- A named region a screen reader can jump to: header, nav, main, footer…
- <main>
- The unique content of the page. One per page.
- <article>
- Content that stands on its own.
- <section>
- A themed part with its own heading.
- <aside>
- Related but secondary content.
- skip link
- A link at the top that jumps keyboard users to the main content.
- div / span
- Meaning-free containers for styling, block and inline.
Rename the rooms in your own site.
What you should see — one way to do it
<body>
<a href="#main">Skip to main content</a>
<header>
<p><a href="index.html">Maria Lopez</a></p>
<nav> …your two links… </nav>
</header>
<main id="main">
<h1>Maria Lopez</h1>
<section>
<h2 id="learning">What I'm learning</h2> …
</section>
<section> <h2 id="contact">How to reach me</h2> … </section>
</main>
<footer>
<p>
© 2026 Maria Lopez ·
<a href="mailto:maria@example.com">Email me</a>
</p>
</footer>
</body>
What you should see: the page looks exactly as before, plus a "Skip to main content" link at the very top. Click in the address bar, press Tab once, then Enter — the page jumps to your <h1>. (In Phase 2 you'll hide the skip link until it receives focus.)
Six questions. Four correct to move on.
"Header, nav, main, footer name the regions. Article stands alone; section has a heading. One main per page. Ask if an element means it before reaching for a div." Your pages now have signposts, not just corridors.