[aria-current]
Example
<nav>
<a href="/" class="active" aria-selected="true">Home</a>
<a href="/blog">Blog</a>
</nav><nav>
<a href="/" aria-current="page">Home</a>
<a href="/blog">Blog</a>
</nav>aria-current='page' tells screen readers which link is the current page; CSS can style it with [aria-current='page'].
Common mistakes
- Highlighting the active nav link only with a CSS class, so screen readers do not know it is current.
- Using
aria-selectedon navigation links, which only works inside widgets like tabs or listboxes.
Key points
- The current page link uses
aria-current='page', notaria-selectedor a class alone. - Only one item in a set has
aria-currentat a time. - The token fits the context: 'page', 'step', 'location', 'date', 'time' or 'true'.
Interview questions
What is the difference between aria-current and aria-selected?
aria-current marks the current item in a set, like a page or step. aria-selected marks chosen items inside widgets such as tabs, listboxes and grids.
Can I style the active link with the aria-current attribute?
Yes. Selecting [aria-current='page'] in CSS keeps the visual state and the accessible state in sync.