Skip to content
easeweb
Search topics

Search boxes and related items left out of the landmark list

A shop's header search is a plain form and its "You may also like" panel sits inside main, so the landmark list has no search and counts the panel as content.

WCAG 2.2
SC 1.3.6AAA· new in 2.1
Required by
Not required by Section 508 or EN 301 549
Broken <form action="/search">
The accessibility problem illustrated: Cognitive:Where is the search?
01

The problem

People who find their way around a page by its areas can't go straight to the search, or tell the shop's suggestions from the product

02

Try it

Use the landmark tool to jump to the search, then show only the main content

The bar above the window stands in for tools that read a page’s landmarks. Jump to lists them, as the SkipTo extension does, and Show only the main content hides everything else, the example the WCAG Understanding page gives for 1.3.6. Is the search in the menu? With only the main content shown, what is still there besides the mug? Then apply a fix and try both again.

Broken Can you fix this?

BrokenA plain search form, and related items inside main

Landmark tool (a stand-in for extensions such as SkipTo)

Enamel mug

$18

You may also like

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Mark the search and the related items as landmarks

Before
BrokenA plain search form, and related items inside main
<header>  <a href="/" class="logo">Tidewater Home</a>  <nav>    <a href="/kitchen">Kitchen</a>    <a href="/table">Table</a>    <a href="/bath">Bath</a>  </nav>  <form action="/search">    <label for="q" class="visually-hidden">Search the shop</label>    <input id="q" name="q" type="search">    <button type="submit">Search</button>  </form></header><main>  <h1>Enamel mug</h1>  <p class="price">$18</p>  <div class="related">    <h2>You may also like</h2>    <ul>…</ul>  </div></main><footer>  <a href="/contact">Contact</a>  <a href="/returns">Returns</a></footer>
What is wrong3 points
  • The search form has no role and no name, so it is not a landmark, and the landmark list has no search.
  • The related items are a div inside main, so the code counts them as the product page's own content.
  • So the list reads "banner", "navigation", "main", "content information", and neither the search nor the suggestions can be reached, kept or hidden by what they are.
After

Search and aside elements

<header>  <a href="/" class="logo">Tidewater Home</a>  <nav>    <a href="/kitchen">Kitchen</a>    <a href="/table">Table</a>    <a href="/bath">Bath</a>  </nav>  <search>    <form action="/search">      <label for="q" class="visually-hidden">Search the shop</label>      <input id="q" name="q" type="search">      <button type="submit">Search</button>    </form>  </search></header><main>  <h1>Enamel mug</h1>  <p class="price">$18</p></main><aside class="related" aria-labelledby="related-title">  <h2 id="related-title">You may also like</h2>  <ul>…</ul></aside><footer>  <a href="/contact">Contact</a>  <a href="/returns">Returns</a></footer>
How it is fixed3 steps
  1. Wrap the search form in a search element. It is the search landmark, so the list shows "search" and choosing it lands on the box. The form inside needs no role.
  2. Move the related items out of main, to sit beside it before the footer. Main now ends with the product.
  3. Make their wrapper an aside, the complementary landmark, and name it with aria-labelledby pointing at its heading, so the list says "You may also like" with it.

The landmark list now reads "banner", "navigation", "search", "main", "complementary, You may also like", "content information", and main holds only the mug. This fixes the Before for its two regions and passes 1.3.6 for them; icons and controls are the rest of the criterion (see Limits). The aside can keep the look the div had: the layout places it under the product with CSS, wherever it sits in the markup.

Why this fix: Use native HTML first

Easily confused
04

Verify the fix

4 checks, no mouse.

Test with: Screen reader, Keyboard

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 gains a new block.

Limits

This is a starting pattern, not a guarantee for every application. Paths, class names and the … in the lists are placeholders, and screen readers word landmarks differently (NVDA, for one, says "content info" for what this guide calls "content information"), so listen for the areas rather than the exact phrasing. This guide covers regions, one of the three things 1.3.6 names. Icons and controls are the others, and WCAG has no published technique for them yet: its Understanding page lists one for controls, using microdata, as a future link. The W3C's attribute for marking a word or a picture with a symbol concept, adapt-symbol in the WAI-Adapt Symbols Module, has been a Candidate Recommendation since January 2023, and it needs two user agents or extensions that act on it before it can move on. Its implementation report names no browser or extension that does, so a page can't count on icons being swapped for a person's own symbols today. What a tool can read from an icon or a control now is its name, so give each one, as icon-only buttons with no accessible name shows. Fields that collect personal data identify their purpose through autocomplete, which form fields that block or break autofill covers. The shell's own landmarks, one main and a header and footer at the top level, are in landmarks that are missing, misplaced or leave content out. 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.

EaseWeb service

Fixed it? Keep it from coming back.

I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.

See the service