Check 11.01 · Semantic HTML and accessibility

Use header, main, nav, article and footer appropriately

Structure each template with header, nav, main, article, aside and footer, with no duplicates or misuse, on WordPress, Shopify, Webflow, Laravel or Next.js.

Priority
Important
Difficulty
Easy
Estimated time
1 to 3 h
Free, no account: your progress is saved in this browser.

Ask an AI to check this point on your site

Opens the assistant with a ready-made question: this check, its goal and your site URL.

For Gemini, Copilot or another assistant, copy the question. The link opens the chosen service directly: nothing goes through this site.

In short

The <header>, <nav>, <main>, <article>, <aside> and <footer> elements divide a page into meaningful areas: site header, navigation, main content, self-contained content, related content, footer. Used correctly, they let screen readers jump from one area to the next and let programs that read the page separate the useful content from the surrounding chrome. Once the check is done, each template has a single visible <main>, a main navigation inside a <nav>, and <article> elements only around content that stands on its own.

Why it matters

Browsers turn these elements into landmarks in the accessibility tree: a page-level <header> becomes banner, <nav> becomes navigation, <main> becomes main, <aside> becomes complementary, a page-level <footer> becomes contentinfo. A screen reader user can list them and jump straight to the main content without listening to the menu on every page. The French government's accessibility framework, the Référentiel général d'amélioration de l'accessibilité (RGAA), checks this explicitly: its criterion 9.2 expects the header in <header>, the main navigation in <nav>, the main content in a single visible <main> and the footer in <footer>.

A page built only from <div> elements holds the same information, but nothing distinguishes the article from the menu, the promotional boxes and the footer repeated across the site. Tools that extract a page's main content (reader modes, HTML-to-text converters, generative engines' ingestion pipelines) then have to guess, and sometimes get it wrong: menu text mixed into the content, a truncated article, the footer taken for the conclusion.

On the search engine side, Google has not documented any ranking effect specific to these elements: it also understands pages built with <div>. To appear in the answers of its generative engines, Bing recommends a clear HTML structure with headings that mark out sections. No element guarantees a citation; clean markup simply reduces the risk of the content being split up or attributed incorrectly.

What it improves

  • Accessibility Navigation by area with a screen reader, a skip link to the main content, compliance with WCAG criteria 1.3.1 (Info and Relationships) and 2.4.1 (Bypass Blocks), RGAA 9.2 and 12.6.
  • Content extraction Tools that isolate the main content get a reliable marker. A plausible effect for generative engines and AI agents, not documented by their vendors.
  • Maintenance Templates become readable; CSS can target main, nav or article instead of arbitrary classes.
  • Ranking No documented direct effect. Do not count on it to gain positions.

How to check

1. List the landmarks in the console. Open the page, then the developer tools console (F12), and paste:

console.table([...document.querySelectorAll('header, nav, main, article, aside, footer, section, search, [role]')]
  .map((el) => ({
    balise: el.tagName.toLowerCase(),
    role: el.getAttribute('role') || '',
    nom: el.getAttribute('aria-label') || el.getAttribute('aria-labelledby') || '',
    parent: el.parentElement.closest('header, nav, main, article, aside, footer, section')?.tagName.toLowerCase() || 'body',
    texte: el.textContent.trim().replace(/\s+/g, ' ').slice(0, 50),
  })));

A compliant result: a single main (not counting hidden elements), one header and one footer whose parent is body or a neutral container, one nav per navigation block, each one named if there are several, and article elements wrapping complete content.

2. Read the accessibility tree. In Chrome DevTools, Elements panel, Accessibility tab, turn on the full-page accessibility tree. The banner, navigation, main and contentinfo landmarks should appear at the top level.

3. Run an automated audit. With axe DevTools or WAVE, look for the landmark rules: missing main, several banner or contentinfo landmarks, content outside any landmark. Lighthouse includes some of these rules in its Accessibility category.

4. Listen to the page. With NVDA on Windows, the D key jumps to the next landmark; with VoiceOver on macOS, VO + U opens the rotor, which lists the landmarks. If the list comes down to “main” or to nothing at all, the structure needs rework.

How to implement

Before you start

Element Exposed role Use Avoid
<header> banner when at page level logo, site name, search, main navigation a <header> for every decorative block
<nav> navigation menus, breadcrumbs, table of contents, pagination each group of links in the footer
<main> main the content specific to the page several visible <main> elements
<article> article blog post, product page, comment, self-contained card an <article> around the whole page “on principle”
<section> region only when it has a name a thematic part with its heading a <section> without a heading as a stand-in for <div>
<aside> complementary related but secondary boxes the main content of a column
<footer> contentinfo when at page level legal notices, contact, service links a <footer> in every card for no reason
<search> search the site search form

Rules to remember:

  • A single visible <main> per document. It must not be placed inside a <header>, <nav>, <article>, <aside> or <footer>.
  • <header> and <footer> change meaning depending on where they are: inside an <article>, <section>, <aside>, <nav> or the <main>, they are no longer landmarks but the header and footer of that block. This is intended: an <article> can have its own <header> (title, date, author) and <footer> (tags, sharing).
  • Name multiple navigation blocks with aria-label: “Main menu”, “Breadcrumb”, “Pagination”.
  • <div> is still legitimate for anything whose only role is layout.
  • Do not add role="main" to <main>: the role is already implicit.

Reference skeleton:

<body>
  <a class="evitement" href="#contenu">Skip to content</a>

  <header>
    <a href="/"><img src="/logo.svg" alt="Atelier Martin, home" width="160" height="40"></a>
    <nav aria-label="Main menu">
      <ul>
        <li><a href="/chaises">Chairs</a></li>
        <li><a href="/tables">Tables</a></li>
        <li><a href="/contact">Contact</a></li>
      </ul>
    </nav>
    <search>
      <form action="/recherche" method="get">
        <label for="q">Search</label>
        <input id="q" name="q" type="search">
        <button type="submit">OK</button>
      </form>
    </search>
  </header>

  <nav aria-label="Breadcrumb">
    <ol>
      <li><a href="/">Home</a></li>
      <li><a href="/chaises">Chairs</a></li>
      <li aria-current="page">Oslo chair</li>
    </ol>
  </nav>

  <main id="contenu" tabindex="-1">
    <article>
      <header>
        <h1>Oslo chair in solid oak</h1>
        <p>Updated on <time datetime="2026-11-20">20 November 2026</time></p>
      </header>
      <p>…</p>
      <section aria-labelledby="entretien">
        <h2 id="entretien">Care</h2>
        <p>…</p>
      </section>
    </article>
    <aside aria-label="Related products">…</aside>
  </main>

  <footer>
    <p>Atelier Martin, 12 rue des Lilas, 69003 Lyon</p>
    <a href="/mentions-legales">Legal notice</a>
  </footer>
</body>

The <search> element is recent; if you need to support older browsers, use <form role="search"> instead.

For the skip link, hide it visually until it receives keyboard focus:

.evitement {
  position: absolute;
  left: -9999px;
}

.evitement:focus {
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: #fff;
  color: #000;
}

Good to know: the old “outline algorithm”, which would have allowed starting again at <h1> in each <section>, was never implemented by browsers and has been removed from the HTML specification. Keep a continuous heading hierarchy across the whole page: see structure H2/H3 headings (opens in a new tab).

WordPress

Versions WordPress 6.4 and later (verified up to 7.1).

  • Block theme (Twenty Twenty-Four, Twenty Twenty-Five and derivatives): Appearance > Editor > Templates. The “Header” and “Footer” template parts are rendered as <header> and <footer>. For the content, select the Group block that wraps the page content, then in the right-hand panel, Advanced section, HTML element setting, choose <main>. The same setting offers <article>, <section>, <aside>, <header> and <footer> for the other groups.
  • Navigation block: it outputs a <nav> with a list of links. If there are several, give each one a different name (the label is used in the aria-label attribute).
  • Classic theme: in a child theme, edit header.php (opening <header> and <nav>), footer.php, then page.php, single.php and index.php to wrap the loop in a <main id="contenu"> and each post in an <article>. Recent themes already do this: check before editing.
  • Page builders: most of them, including Elementor, offer an HTML tag setting in the layout options of their containers. Use it for the header, the footer and the main container, and check the result in the console.

Shopify

Versions Online Store 2.0 themes with section groups (Dawn and derivatives), November 2026.

The layout/theme.liquid file holds the shared structure. In recent themes, including Dawn, {{ content_for_layout }} is already wrapped in a <main id="MainContent"> and the header is rendered by a section group. Check three points in Online Store > Themes > … > Edit code:

<a class="skip-to-content-link" href="#MainContent">{{ 'accessibility.skip_to_text' | t }}</a>

{% sections 'header-group' %}

<main id="MainContent" tabindex="-1">
  {{ content_for_layout }}
</main>

{% sections 'footer-group' %}

In sections/main-product.liquid or main-article.liquid, a product page or a blog post can be wrapped in an <article>. Footer sections should be rendered inside a single <footer>, without a <footer> nested in each block.

Wix

Versions Wix Editor and Wix Studio, November 2026.

Wix generates the basic structure itself. In Wix Studio and recent versions of the editor, sections and containers offer a semantic HTML tag setting in their accessibility settings: assign header, main or footer to the matching areas. The exact labels vary by editor; refer to the Wix help center on accessibility.

Squarespace

Versions Squarespace 7.1, November 2026.

Squarespace generates the header, navigation, content area and footer of each template: there is no tag setting per section. Check the result in the console, and report a template issue to support rather than trying to work around it with injected code.

Webflow

Versions Webflow Designer, all plans, November 2026.

Select a Section, Div Block or Container element and open the Settings panel (gear icon): the Tag menu lets you choose header, nav, main, section, article, aside or footer. Use the Navbar element for the main menu, and reserve main for the container of each page's content, including in CMS collection templates.

Laravel

Versions Laravel 10 to 13, Livewire 3 and 4.

Put the structure in the shared Blade layout, resources/views/layouts/app.blade.php:

<body>
    <a class="evitement" href="#contenu">{{ __('Skip to content') }}</a>

    <header>
        <x-navigation.main />
    </header>

    <main id="contenu" tabindex="-1">
        {{ $slot }}
    </main>

    <footer>
        <x-footer />
    </footer>
</body>

The x-navigation.main component renders a <nav aria-label="{{ __('Main menu') }}">. In content views, wrap posts and product pages in an <article>. With Livewire or Inertia, page components are inserted into $slot: do not let them output a second <main>.

Next.js

Versions Next.js 15 and 16 (App Router).

With the App Router, the shared structure goes in app/layout.tsx:

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="fr">
      <body>
        <a className="evitement" href="#contenu">Skip to content</a>
        <header>
          <MainNav />
        </header>
        <main id="contenu" tabIndex={-1}>
          {children}
        </main>
        <footer>
          <SiteFooter />
        </footer>
      </body>
    </html>
  );
}

The page.tsx files then return an <article> or <section> elements, never a <main>. Nested layouts (app/blog/layout.tsx) must not repeat a page-level <header> or <footer>.

Nuxt

Versions Nuxt 4; Nuxt 3 (end of support on 31 July 2026) with the same files at the project root.

Since Nuxt 4, application code lives in the app/ folder. Put <header>, <main> and <footer> in app/layouts/default.vue (layouts/default.vue in Nuxt 3), around <slot />, and let the pages in app/pages/ return their content in an <article> or <section> elements. Check that app/app.vue does not add a second <main> around <NuxtLayout>.

Astro

Versions Astro 5 and 6.

The shared layout (src/layouts/Base.astro) holds <header>, <main id="contenu"> around <slot />, and <footer>. Pages in src/pages/ and content collection templates return an <article>.

Common mistakes

  • Two visible <main> elements: common when a layout and a page component each add one. The second should become a <div> or an <article>.
  • Putting the menu outside <nav> or, conversely, wrapping each group of footer links in a <nav>: the list of landmarks becomes unreadable.
  • Several unnamed <nav> elements: the screen reader announces “navigation” three times without telling them apart.
  • <section> as a systematic replacement for <div>: without a heading, it adds nothing and makes the code harder to read.
  • <article> around the whole page on a brochure site: reserve it for content that would make sense on its own, republished elsewhere.
  • Adding redundant ARIA roles (<nav role="navigation">): pointless, and a source of errors when roles and elements get mixed up. See use ARIA when necessary (opens in a new tab).
  • Hiding the skip link with display: none: it can then never be reached with the keyboard.

Frequently asked questions

Do the header, main and article elements improve SEO?

Not directly: Google has documented no ranking effect specific to the header, main, nav or article elements, and it also understands pages built with div. Their value lies elsewhere: screen reader navigation, RGAA and WCAG compliance, and reliable markers for tools that extract a page's main content, which limits splitting errors. It is a low-cost good practice, not a ranking lever.

What is the difference between section and article?

An article is self-contained content that would keep its meaning if it were published on its own elsewhere: a blog post, a product page, a comment, a news card. A section is a thematic part of a larger whole, introduced by a heading, such as the “Care” chapter of a product page. If neither fits, use a div: it remains correct for anything that is only layout.

Do generative engines use the main element to find content?

No generative engine vendor documents precisely how it extracts content. However, common HTML-to-text conversion tools and reader modes rely on structural cues such as main and article to discard menus and footers. Clean markup therefore reduces the risk of your content being mixed up with the surrounding chrome, without guaranteeing a citation or a recommendation.

Updated on

Topic checklist (PDF)

And now?

In the “Semantic HTML and accessibility” topic

  1. Use header, main, nav, article and footer appropriately
  2. Use elements suited to the content
  3. Structure tables and lists with native elements
  4. Distinguish action buttons from navigation links
  5. Provide ALT text for informative images
  6. Use empty ALT for decorative images
  7. Check color contrast
  8. Test keyboard navigation
  9. Check form labels
  10. Use ARIA when necessary
  11. Check DOM reading order
  12. Avoid information available only on hover
  13. Provide text alternatives for media
  14. Check applicable WCAG guidelines
  15. Test with axe, WAVE or Lighthouse