Image in link alt text
Silktide finds links that contain an image but no readable text of any kind. Such a link has no name, so people who cannot see the image have no way to know where it leads.
<!-- Problem: the link has no accessible name -->
<a href="/apple">
<img src="apple.png">
</a>
<!-- Fixed: the alt text names the link -->
<a href="/apple">
<img src="apple.png" alt="A red apple">
</a>
Why this matters
When a link's only content is an image, the image's becomes the link's name. Without it, a announces something like "link" or falls back to reading the destination URL or the image filename - none of which tells the listener where the link goes. Navigation built from image links, such as logos and icon menus, becomes guesswork.
Keyboard and voice-control users are affected too: a link with no name is hard to target with voice commands and meaningless in a list of links.
How to fix it
- Add alt text to the image that describes the purpose of the link - where it goes or what it does - rather than what the image looks like. For a linked logo, "Home" or your organisation's name beats "logo".
- Alternatively, add visible text inside the link beside the image; the image
can then have an empty
alt="". - Fix templates in your where the same unlabeled icon link repeats across pages.
How Silktide tests this
- Find every image that sits inside a link, skipping links hidden from screen readers.
- Read all the text the link exposes to , including the alt text of everything inside it.
- Report the image when that combined text contains no letters or numbers, leaving the link with no usable name.
Unlike other alt text checks, an empty alt="" does not pass here: if the image
is the link's only content, marking it decorative leaves the link nameless.
Troubleshooting
The image is decorative
Inside a link with no other text, an image cannot be treated as purely - something has to name the link. Either give the image alt text describing the destination, or add visible text to the link.
The link is labeled another way
This check reads text and alt text within the link. If your link is named by other means and you have verified it announces correctly in a screen reader, you can the finding.