SVG marked as an image has no name

  • WCAG 1.1.1 Non-text Content, level A
  • Serious
  • Images
  • Automated
  • Server pass

Why it matters

An SVG with role="img" is announced as an image. Without a name, people hear "image" and nothing else.

How to fix it

Add an aria-label, or a <title> inside the SVG referenced by aria-labelledby. If it is decorative, use aria-hidden="true" and drop the role.

<!-- Before -->
<svg role="img" viewBox="0 0 24 24">...</svg>

<!-- After -->
<svg role="img" aria-label="Warning" viewBox="0 0 24 24">...</svg>

Read the W3C guidance: Understanding 1.1.1 Non-text Content.

Related rules

Find this on your own site. A11yMate scans every page and lists where it happens. See pricing or browse all rules.