Skip to content
easeweb
Search topics

Headings chosen by size, not by structure

A recipe page styles its main section titles as divs, uses an h5 for a small title and an empty h2 to draw a rule, so a screen reader's headings list misses the sections the page is for.

WCAG 2.2
SC 1.3.1ASC 2.4.6AA
Required by
Section 508 · EN 301 549 (EU)
Broken <div class="section-title">Method</div>
The accessibility problem illustrated: Ingredients and Method look like headings. They aren't.
01

The problem

Screen reader users can't skim the page by its headings, because the main sections aren't headings at all.

02

Try it

Use the headings list to jump to the method.

The list shows the headings a screen reader finds on this recipe page, and the tag beside each title shows its markup. Choose an entry to jump to it. Can you reach Method?

Broken Can you fix this?

Lentil soup<h1>

A thick, warming soup for weeknights.

<h2>
Ingredients<div>
  • 1 onion
  • 2 carrots
  • 200 g red lentils
  • 1 litre vegetable stock
Method<div>
  1. Soften the onion and carrots.
  2. Add the lentils and stock.
  3. Simmer for 25 minutes, then blend.
Tips<h5>

A squeeze of lemon brightens it.

More<h2>
  • Tomato soup
  • Pea soup
  • Leek and potato soup

Screen reader’s headings list:

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Mark every section title as a heading at the level of its place in the outline, and style it with a class.

  1. 1Every visible section title is a heading: an h1–h6 element, or role="heading" with aria-level.
  2. 2Take the level from the outline and the size from a class.
  3. 3Every heading has words that name its section, and nothing else is a heading.
Before Titles marked up for their look
<h1>Lentil soup</h1><p>A thick, warming soup for weeknights.</p><h2 class="divider"></h2> <div class="section-title">Ingredients</div><ul>…</ul> <div class="section-title">Method</div><ol>…</ol><h5>Tips</h5><p>…</p> <h2>More</h2><ul class="cards">…Tomato soup, Pea soup, Leek and potato soup…</ul>
After

Heading elements at the right level

<h1>Lentil soup</h1><p>A thick, warming soup for weeknights.</p> <h2 class="section-title divider">Ingredients</h2><ul>…</ul> <h2 class="section-title">Method</h2><ol>…</ol><h3 class="title-small">Tips</h3><p>…</p> <h2 class="section-title">More soup recipes</h2><ul class="cards">…Tomato soup, Pea soup, Leek and potato soup…</ul>

Why this fix: Use native HTML first

Fixing this with an AI coding assistant? Get this guide as Markdown

04

Verify the fix

4 checks, no mouse.

Test with: Screen reader

0 of 4 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat whenever a template, a shared heading component or the CMS editor's styles change.

Limits

This is a starting pattern, not a guarantee for every application. Class names, colours and the … in the lists are placeholders. Screen readers word the headings list differently, so listen for the titles and levels rather than the exact phrasing. This guide covers whether titles are headings, their levels and their words. It doesn't cover whether long content has enough headings in the first place, or the labels on form fields. Test the complete journey with your target assistive technology.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

Keep this fixed as your code changes.

Turn guides like this into rules your coding agents and CI follow, then have the result retested with a keyboard and screen readers.

How retests work