Fix Inaccessible Images, Icons, Links & Buttons
In this article
If a screen reader announces "button" or "link" with no name, or skips an image entirely, the fix is almost always the same: give the element a real accessible name. For images that means an alt attribute; for icon-only buttons and links it means visible text, an aria-label, or a visually hidden span; for decorative graphics it means hiding them from the accessibility tree with alt="" or aria-hidden="true". Below is a practical, step-by-step process you can apply to a page or a whole site, with the checks that catch the most common failures.
What You'll Need
- A screen reader for testing: NVDA or JAWS on Windows, VoiceOver on macOS and iOS, TalkBack on Android, or Orca on Linux. You only need one to start.
- Browser developer tools (built into Chrome, Edge, Firefox and Safari) to inspect the accessibility tree.
- Access to the source code or CMS where you can edit HTML, templates, or image metadata.
- Optional but useful: an automated checker such as axe DevTools, Lighthouse, or WAVE to flag missing names quickly. Automated tools catch maybe a third of issues, so manual testing still matters.
Step-by-Step
- Audit what the screen reader actually says. Turn on your screen reader and tab through the page. Listen for controls announced only as "button", "link", "image", or with a file name like "IMG_2043.jpg". Note each one and its location. This gives you a concrete list rather than guessing.
- Classify each item as meaningful or decorative. A product photo, a chart, or a logo that links home is meaningful. A background flourish, a spacer, or an icon that merely repeats adjacent text is decorative. The fix differs, so decide first.
- Fix meaningful images with descriptive
alttext. Write what the image conveys in context, not what it looks like. For a chart, summarise the trend in the alt or in nearby text. Keep it concise; if the image needs a long description, put that in the surrounding prose and use a short alt. Do not start with "image of" or "picture of" — screen readers already announce the role. - Hide decorative images. Use
alt=""(empty, no space) on<img>elements, oraria-hidden="true"on inline SVGs and icon fonts. This removes them from the accessibility tree so they are not announced as noise. Never omit the alt attribute entirely on an<img>; some screen readers will then read the file name. - Give icon-only buttons and links an accessible name. The most robust method is visible text. If design requires an icon alone, add
aria-label="Search"to the button, or include a visually hidden span inside it with the same word. Make the label describe the action ("Search", "Close dialog", "Add to cart"), not the icon ("magnifying glass"). - Check link text out of context. Screen reader users often pull up a list of all links. "Read more" repeated ten times is useless. Either make the visible text specific ("Read more about shipping") or add an
aria-labelthat includes the destination or topic. Avoidtitleattributes as the only source of a name; support is inconsistent. - Confirm the accessible name in the browser. In Chrome or Edge DevTools, open the Elements panel, select the element, and check the Accessibility pane. It shows the computed name, role, and whether the element is ignored. If the name is empty, the screen reader will likely announce only the role.
- Test keyboard and screen reader together. Tab to each control and listen. Activate buttons with Enter and Space, links with Enter. If focus lands on something with no announcement, or the announcement is wrong, return to step 5.
- Fix forms and other controls the same way. Inputs need a programmatically associated
<label>(viafor/id) or anaria-label. Placeholder text is not a label. Select menus, checkboxes, and custom widgets all need a name and a state that assistive tech can read. - Re-run automated checks and spot-check manually. Automated tools will confirm missing alt attributes and empty names, but only listening to the screen reader confirms the experience. Repeat the audit on a second page type (for example a product page and a checkout page) to catch template-level problems.
Common Mistakes
- Using
alt="image"oralt="photo"— it adds no information and is announced as noise. - Leaving the alt attribute off entirely instead of using an empty value for decorative images.
- Putting the accessible name only in a
titletooltip, which many screen readers ignore or read inconsistently. - Labelling an icon button with the icon name ("hamburger") rather than the action ("Open menu").
- Adding
aria-labelto a non-interactive<div>that is not a button or link — it will not become focusable or operable. - Forgetting that
aria-hidden="true"on a focusable element hides it from screen readers while it remains keyboard-focusable, creating a "ghost" stop. - Assuming a visible text label is enough if CSS hides it with
display:none; that also hides it from assistive tech. Use a visually-hidden technique that keeps it in the accessibility tree.
Tips
- Write alt text as if you were describing the image to someone over the phone in one sentence.
- For logos that link to the home page, the accessible name should be the site name, not "logo".
- For icon fonts, ensure the icon character itself is hidden from screen readers (often with
aria-hidden="true"on the icon span) and the button carries the label. - Keep button and link names short but unique enough to be understood in a list.
- Test with the screen reader's link list and form-control list, not just linear reading — that is where vague names hurt most.
- Add alt-text requirements to your CMS workflow so new images do not reintroduce the problem.
Troubleshooting
If the screen reader still announces nothing useful after you add a label, check the following in order. First, confirm the attribute is on the element that actually receives focus — not on a wrapping <div> or a hidden sibling. Second, check whether another attribute overrides it: an aria-labelledby pointing to an empty or missing ID will win over aria-label. Third, look for aria-hidden="true" on an ancestor; it hides the whole subtree. Fourth, verify the element has a valid role — a <div> with a click handler is not a button to assistive tech unless it has role="button" and keyboard handling. Fifth, clear the browser cache or hard-reload, because some CMSs serve cached templates. If automated tools report no issues but the screen reader still fails, trust the manual test; automated rules cannot judge whether a name is meaningful.
Frequently Asked Questions
Do I need alt text on every image?
Every <img> needs an alt attribute, but decorative images should have an empty one (alt=""). The attribute must be present; its value can be empty.
Is aria-label better than visible text?
Visible text is generally better because it helps everyone, including sighted users and voice-control users. Use aria-label when design truly requires an icon-only control.
Why does my icon button read as "button" with no name?
The button likely contains only an SVG or icon font with no text alternative. Add visible text, a visually hidden span, or an aria-label describing the action.
Can I use the title attribute instead?
It is unreliable as the only accessible name and is not consistently exposed. Prefer alt, visible text, or aria-label.
How do I test quickly without installing a screen reader?
Use the Accessibility pane in browser DevTools to inspect computed names and roles. It is fast for spotting empty names, though a real screen reader test is still recommended before shipping.
Does this apply to mobile apps too?
The principle is the same: every image and control needs a programmatic name. On iOS and Android the APIs differ (accessibility labels and content descriptions), but the audit method — listen with VoiceOver or TalkBack — is identical.