Explain it simply
Explain it simply
A shopping mall has a map at the entrance that splits the building into areas such as the entrance, the shops, the food court and the exits, so you can head straight to the part you want. Layout elements are that map for a web page.
<header> is the top of the page, <nav> holds navigation links, <main> is the page's primary content and <footer> is the closing information. Screen reader users jump between these areas, called landmarks, with a shortcut key, reaching the main content without listening to every menu link first.
Problem → Why → Solution
The problem: every wrapper a section, with duplicate navs and mains
Having heard that semantic tags are good, a developer swaps every div for a section and adds a second main inside the sidebar. The page now has two main landmarks, and a screen reader lists two unnamed "navigation" regions, so nobody can tell which is the main menu. The heading-less sections are not meaningful parts at all, just styling boxes.
<section class="top-bar">
<section class="logo">Shop</section>
<nav><a href="/">Home</a> <a href="/sale">Sale</a></nav>
</section>
<main>
<section class="card">Product list...</section>
</main>
<main class="sidebar">Filters...</main>
<nav><a href="/privacy">Privacy</a></nav>Why does this happen?
Landmark elements build a map of what parts a page has. There can only be one main content area, so two mains muddle the map, and several unnamed navs cannot be told apart. A section should be a thematic group with its own heading; a box that exists only for CSS should stay a div.
Core concept: landmarks, and when an element becomes one
Most layout elements get a landmark role in the accessibility tree: <nav> becomes navigation, <main> becomes main, <aside> becomes complementary. <header> and <footer> depend on context. At the body level they are the banner and contentinfo landmarks; inside an <article>, <section>, <main>, <aside> or <nav> they are just that part's header or footer and are not landmarks. That is why giving every blog post its own <header> is perfectly fine.
A page should have only one visible <main>: put the page's unique content inside it and keep the header, menus and footer repeated across the site outside. You may have many <nav> elements, but give them names such as aria-label="Main" and aria-label="Footer" so a screen reader announces "Main navigation" and "Footer navigation". Native HTML has no attribute for naming a landmark, which makes this a proper use of ARIA. Not every group of links needs a nav; keep it for major navigation blocks.
An <article> is content that still makes complete sense when lifted out of the page and placed elsewhere, such as in an RSS feed or a share card: a blog post, a product card, a single comment. A <section> is a group about one theme with its own heading, such as "About Us" or "Pricing". A section becomes a region landmark only when it has a name, for example through aria-labelledby; without one it is a plain grouping. An <aside> holds content that is related to the main content but could be removed without hurting it, such as related links or a sidebar.
| Element | Landmark role | Use for |
|---|---|---|
| <header> (body level) | banner | Logo, site title, main menu |
| <nav> | navigation | Major groups of links |
| <main> | main | The page's unique content (one) |
| <aside> | complementary | Related side content |
| <footer> (body level) | contentinfo | Copyright, contact, policy links |
- Site-wide parts: header, footer
- Navigation blocks: named navs
- This page's content: one main
- Inside: article and section
- Styling only: div
Each landmark is an area on the map: clearly named and never duplicated by accident.
General pattern
<header>Site identity <nav aria-label="Main">...</nav></header>
<main>
<article><h2>Self-contained item</h2>...</article>
<section aria-labelledby="topic-id"><h2 id="topic-id">Topic</h2>...</section>
<aside>Related content</aside>
</main>
<footer><nav aria-label="Footer">...</nav></footer>The site-wide header and footer sit outside main, and all of this page's content lives in one main. Each nav gets an aria-label, and the section is named by its own heading.
Example: a simple page with four landmarks
Without CSS this page looks exactly like a div-based version would. The difference is in the accessibility tree, where four landmarks appear: banner, navigation, main and contentinfo. Compare that with the problem page above, which had two mains.
<header>
<h1>My Website</h1>
<nav><a href="#home">Home</a> <a href="#about">About</a></nav>
</header>
<main>
<section id="about">
<h2>About Us</h2>
<p>Main content goes here.</p>
</section>
</main>
<footer>
<p>© 2026 My Website</p>
</footer>Code breakdown
- Page header
<header>As a direct child of body it becomes the banner landmark, holding the site title <h1> and the main menu.
- Navigation
<nav><a href="#home">Home</a> <a href="#about">About</a></nav>The navigation landmark. With only one nav on the page a name is optional, but once a footer menu is added it should get aria-label="Main".
- Main
<main>All of the page's unique content lives here. "Skip to content" links usually point at this element.
- Section
<section id="about">A thematic group headed "About Us". Its id is the target of the #about link, and without aria-labelledby it is not a region landmark.
- Page footer
<footer>At body level it is the contentinfo landmark, the place for copyright, contact and policy links.
A large "My Website" heading appears at the top, the Home and About links sit on one line below it, then the "About Us" heading and the "Main content goes here." paragraph, and "© 2026 My Website" at the bottom. A screen reader's landmark list shows banner, navigation, main and contentinfo.Articles inside articles
Articles can be nested, and an inner article is understood as related to the outer one. Comments on a blog post are the classic case: each comment is self-contained, with an author, a time and text, yet it responds to the post, so the comments sit inside the post's article under a section headed "Comments".
Skip links: jumping straight to main
Keyboard users have to Tab through every menu link on each new page. A skip link as the first link on the page, pointing at main's id, gets them to the content with one Tab and Enter. A common approach hides it with CSS until it receives focus.
<body>
<a href="#content">Skip to main content</a>
<header>...site menu with many links...</header>
<main id="content">
<h1>Page title</h1>
</main>
</body>In real projects
Where this shows up in real projects
In frameworks such as Next.js or Astro, a layout component adds the header, nav and footer to every page, and each page component supplies what goes inside <main>. So you write main once in the layout and make sure page components do not add another; a doubled main is a regular code review finding.
On news and e-commerce sites, a listing page contains many <article> cards, each with its own heading, image and link. A product page splits "Description", "Reviews" and "Shipping" into headed sections and puts "You may also like" in an aside. Accessibility audits open the screen reader's landmark list and ask whether the page's map makes sense.
Common mistakes
Common mistakes
1. Making every styling wrapper a section
Wrappers that exist only for CSS, such as a flex container or a card's inner box, should be divs. A pile of heading-less sections makes the document structure noisy and meaningless.
2. Two mains, or the site header inside main
Keep exactly one visible main. Put the site-wide header inside main and the banner landmark disappears, and "skip to main" no longer skips the menu.
3. Several navs with no names
When the header menu, breadcrumb and footer menu are all announced as just "navigation", nobody can tell them apart. Use aria-label="Main", "Breadcrumb" and "Footer", and leave the word "navigation" out of the label because the role already says it.
Best practices
Best practices
- Start every section with a heading; if there is nothing to call it, ask whether it should be a div.
- Write main once, in the layout component.
- Open a screen reader's landmark list and review the page's map at least once.
Mini challenge
Mini challenge: a blog post page
Build a blog post page with the right landmarks. No CSS is needed; focus on the accessibility tree.
- A site header containing the site name and a nav with aria-label="Main"
- One main holding an article with its own header (h1 plus the author)
- Two headed sections inside the article
- An aside for related posts, and a page footer with a nav labelled "Footer"
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Learning HTML forms - Aye's blog</title>
</head>
<body>
<!-- TODO: site header with the blog name and the main nav -->
<!-- TODO: main > article with its own header, then two headed sections -->
<!-- TODO: aside with links to related posts -->
<!-- TODO: page footer with a footer nav and a copyright line -->
</body>
</html>Expected: The landmark list shows banner, navigation "Main", main, complementary, contentinfo and navigation "Footer". The article's header does not appear as a landmark.
Show hint
It is correct that the article's header is not a landmark. The aside can sit inside main or beside it, just not inside the article.
Show solution
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Learning HTML forms - Aye's blog</title>
</head>
<body>
<header>
<p>Aye's blog</p>
<nav aria-label="Main">
<a href="/">Home</a> <a href="/posts">All posts</a>
</nav>
</header>
<main>
<article>
<header>
<h1>Learning HTML forms</h1>
<p>By Aye Aye, 9 November 2026</p>
</header>
<section>
<h2>Why labels matter</h2>
<p>Labels give every field a name.</p>
</section>
<section>
<h2>Validation basics</h2>
<p>The browser checks required fields for you.</p>
</section>
</article>
<aside>
<h2>Related posts</h2>
<a href="/posts/tables">Accessible tables</a>
</aside>
</main>
<footer>
<nav aria-label="Footer">
<a href="/privacy">Privacy</a> <a href="/contact">Contact</a>
</nav>
<p>© 2026 Aye's blog</p>
</footer>
</body>
</html>Quick quiz 1 / 3
Quick quiz 2 / 3
Quick quiz 3 / 3
What to remember
- Body-level header/footer are banner/contentinfo, nav is navigation, main is main and aside is complementary.
- Keep one visible main and name multiple navs with aria-label.
- article is self-contained content, section is a headed thematic group, div is a styling wrapper.
- Headers and footers inside an article are not landmarks, so every post may have its own.