Skip to content
easeweb
Search topics

Navigation that marks the current page only by its look

The menu link for the page you are on is bold and underlined by a class, but nothing in the markup says it is the current page.

WCAG 2.2
SC 1.3.1A
Required by
Section 508 · EN 301 549 (EU)
Broken class="active"
The accessibility problem illustrated: No vision:Which page am I on?
01

The problem

Screen reader users move through the menu without being told which page they are on

02

Try it

Press Tab to move through the menu

The panel shows what a screen reader says on each link. Can you tell which page you are on? Press Enter on another link to move there.

Broken Can you fix this?

BrokenThe current link marked by a class

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Mark the current page in the code, not just by its look

Before
BrokenThe current link marked by a class
<nav aria-label="Main">  <ul>    <li>      <a href="/">Home</a>    </li>    <li>      <a href="/products">Products</a>    </li>    <li>      <a href="/pricing" class="active">Pricing</a>    </li>    <li>      <a href="/contact">Contact</a>    </li>  </ul></nav>
What is wrong2 points
  • Nothing tells a screen reader which page you are on. The active class gives the Pricing link its look and nothing else.
  • The current link sounds like any other. A screen reader reads it as "Pricing, link", the same as the other three.
After

Aria-current on the link

<nav aria-label="Main">  <ul>    <li>      <a href="/">Home</a>    </li>    <li>      <a href="/products">Products</a>    </li>    <li>      <a href="/pricing" aria-current="page">Pricing</a>    </li>    <li>      <a href="/contact">Contact</a>    </li>  </ul></nav>
How it is fixed2 steps
  1. Replace the class with aria-current="page", which tells assistive technology that this link is the page being shown. Screen readers announce it as "current page".
  2. Select the style on the attribute instead of a class, so the look and the code come from one marker and can't point at different links.

This fixes the Before and passes 1.3.1. The link keeps its href, so it stays in the Tab order and still works as a link.

04

Design ideas

The current page can be marked in more than one look

Four ways to show that Pricing is the page you are on. Point at the links, Tab through them, and click one to move the mark there. Two pass; one marks the link by colour alone, and one only draws a shape under it, so a screen reader never hears “current page”.

In the design file

  • Draw the link to the page you are on as its own state, separate from hover and focus, marked by more than colour, such as bold text, a line or a shape.
  • Mark it with bold text or a line, because a fill or a text colour alone disappears in a Windows contrast theme.
  • Draw hover and focus on the current link too, since it is still a working link.
  • If you like, draw a lighter mark on the section a page sits in, such as Products, different from the current page’s mark.

Passes

  • Solid dark pill Pricing is white on a #1a1a1a pill, a solid shape at 17.40:1 against the page; hover gives the others a pale #f0eeeb pill. A thin border, invisible here, keeps the pill’s outline in a contrast theme, which drops fills.
  • Soft tint with a dot A pale #e9eefa pill with a #2456c9 dot and bold #1a1a1a text. The tint is only decoration; the dot, 5.56:1 against it, and the bold weight carry the mark, and both stay in a contrast theme.

Fails

  • Brand blue, and nothing elseWCAG 1.4.1 Pricing turns brand blue #2456c9 while the others stay #555555. Each reads well on white, 6.46:1 and 7.46:1, but the two are only 1.15:1 apart, under the 3:1 at which a lighter or darker shade counts as a cue of its own, so in greyscale or a contrast theme all four look alike.
  • Dark pill that slides along a trackWCAG 1.3.1 A #1a1a1a pill glides along a #f0eeeb track to the link you click, in 0.25 seconds. Here the pill is a shape of its own, placed by a script, and nothing on the link says it is current, so a screen reader reads “Pricing, link” like the other three.
05

Verify the fix

5 checks, no mouse.

Test with: Screen reader, Keyboard, Forced colors

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the menu or router changes.

How screen readers handle aria-current="page"

Limits

This is a starting pattern, not a guarantee for every menu. Screen readers word aria-current differently, and some say it before the link name and some after. A menu that marks the right link still leaves people lost on a site with a confusing structure; a clear page title, heading and breadcrumbs carry the rest. A page whose menu marks nothing because no menu link has its address, such as a product, is covered in deep pages with no breadcrumb or highlighted menu section. The menu itself also needs to keep its links in the same order, with the same names, from page to page; see navigation menus that change order or names between pages.

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