sfw/fix
link-name high

link-name: Links must have discernible text

An anchor has no perceivable text, so screen readers announce "link" with nothing to tell the user where it goes.

What you see

Links must have discernible text
Element does not have text that is visible to screen readers
<a href="/cart"><svg>...</svg></a>

What’s actually happening

axe flags an `<a>` that has no accessible name. A screen reader reaches it and says just "link" — or reads the raw href — with nothing about the destination. It shows up most on icon-only links (a cart glyph, a social icon), image links whose inner `<img>` has no alt, and "empty" anchors used as JS hooks. Users navigating by a list of links get a column of identical "link, link, link."

Common causes

  • Icon-only links where the icon is an inline SVG or icon font with no text and no label.
  • Image links whose `<img>` has no alt, so there's no text inside the anchor at all.
  • Anchors holding only whitespace or a CSS-injected `::before` glyph, which doesn't count as accessible text.
  • Text hidden with `display:none` or `visibility:hidden`, which removes it from the accessibility tree too.
  • Duplicate "Read more" links that technically have text but no context — valid for this rule, still a usability problem screen-reader users hit.

How to fix it

  1. Add visible text whenever the design allows itThe simplest fix and the best for everyone: put real text in the anchor. If layout demands an icon only, pair it with a visually hidden label using an `.sr-only` class (clip the text, don't `display:none` it — that hides it from screen readers too).
  2. Label icon-only links with aria-labelFor a glyph link with no room for text: `<a href="/cart" aria-label="View cart"><svg aria-hidden="true">...</svg></a>`. Mark the SVG `aria-hidden="true"` so it isn't announced on top of the label. aria-label overrides inner content as the accessible name.
  3. Give image links alt text on the inner imageIf the anchor wraps an `<img>`, the alt becomes the link's name: `<a href="/home"><img src="logo.svg" alt="Home"></a>`. Describe the destination, not the picture. This fixes link-name and image-alt in one move.
  4. Make "Read more" links self-describingA page full of identical "Read more" links passes the bare rule but fails users. Append context ("Read more about pricing") or attach `aria-label="Read more about pricing"` so each link stands on its own out of context.

Stop it recurring

Lint for anchors whose only child is an SVG/icon and require an aria-label or sr-only span before they render.

Related errors