Accessibility guides

How to fix "Links must have discernible text"

Screen reader users often move through a page by listing its links. A link with no text is announced as just "link", or as its raw address. This fails WCAG 2.4.4 and 4.1.2. It almost always comes from a link that contains only an icon or an image.

Three correct fixes

1. Name the image inside the link.

<a href="/cart"><img src="cart.svg" alt="Cart"></a>

2. Add a label to the link when the icon is an inline SVG or a font icon. Hide the icon itself from assistive technology.

<a href="/search" aria-label="Search">
  <svg aria-hidden="true" focusable="false">...</svg>
</a>

3. Add visually hidden text, which also helps voice-control users who say the link's name.

<a href="https://instagram.com/harborcandle">
  <svg aria-hidden="true">...</svg>
  <span class="visually-hidden">Harbor Candle Co. on Instagram</span>
</a>

Things that look like fixes but are not

Check your own site

Our free scanner loads your pages in a real browser and lists every failure like this one that automated testing can detect. Scan a site.