---
title: "role=\"img\" element has no text alternative (a11y/role-img-alt)"
description: "a11y/role-img-alt: Elements with role=\"img\" (icon spans, CSS background images) have no alt attribute, so without a name they are announced as unlabeled…"
canonical: https://void-design.vercel.app/rules/a11y/role-img-alt
lastModified: 2026-09-16
---

# role="img" element has no text alternative

`a11y/role-img-alt` · severity **error** · category Accessibility · detected by `void a11y` and `void audit`

## Why it matters

Elements with role="img" (icon spans, CSS background images) have no alt attribute, so without a name they are announced as unlabeled images.

## How to fix it

Add aria-label or aria-labelledby. For purely decorative elements remove role="img" and use aria-hidden="true".

## References

- https://dequeuniversity.com/rules/axe/4.13/role-img-alt

## More accessibility rules

`void a11y` reports 48 rules in this category. WCAG 2.2 AA through axe-core, plus checks axe can't do alone: visible keyboard focus, 24/44px target size on mobile, 320px reflow and disabled zoom.

- `nested-interactive` Interactive controls are nested — [a11y/nested-interactive](https://void-design.vercel.app/rules/a11y/nested-interactive)
- `duplicate-id-aria` Duplicate id referenced by ARIA — [a11y/duplicate-id-aria](https://void-design.vercel.app/rules/a11y/duplicate-id-aria)
- `frame-title` <iframe> has no title — [a11y/frame-title](https://void-design.vercel.app/rules/a11y/frame-title)
- `svg-img-alt` SVG image has no text alternative — [a11y/svg-img-alt](https://void-design.vercel.app/rules/a11y/svg-img-alt)
- `tabindex` Positive tabindex — [a11y/tabindex](https://void-design.vercel.app/rules/a11y/tabindex)
- `scrollable-region-focusable` Scrollable region is not keyboard accessible — [a11y/scrollable-region-focusable](https://void-design.vercel.app/rules/a11y/scrollable-region-focusable)
- `link-in-text-block` Links in text are distinguished only by color — [a11y/link-in-text-block](https://void-design.vercel.app/rules/a11y/link-in-text-block)
- `autocomplete-valid` Invalid autocomplete value — [a11y/autocomplete-valid](https://void-design.vercel.app/rules/a11y/autocomplete-valid)

Detected by `void a11y` and `void audit`. Explain it in a terminal: `void rules a11y/role-img-alt`
