Features

Ensure <img> elements have alternative text or a role of none or presentation

Rule ID: image-alt User Impact: critical Guidelines: WCAG 2.0

Ensure that all <img> elements include appropriate alternative text to convey their purpose and meaning to users who rely on assistive technologies.

About This Rule

This rule ensures that all images have appropriate alternative text, enhancing accessibility for users who rely on screen readers. Adhering to this guideline aligns with the following standards:

Why It Matters

Screen readers cannot interpret images directly. Without alternative text, users who are blind or have low vision miss out on the information conveyed by images. Providing descriptive alternative text ensures that all users have equal access to the content and functionality of a webpage.

How to Fix

To make images accessible:

  • Informative Images: Add a concise and descriptive alt attribute to each informative image, summarizing its content or function. For example:
    Copy code
    <img src="cat.jpg" alt="A drawing of a cat">
  • Decorative Images: For images that are purely decorative and do not convey meaningful information, use an empty alt attribute to allow screen readers to skip them:
    Copy code
    <img src="decorative-line.jpg" alt="">
  • Complex Images: For images requiring more detailed descriptions, consider providing additional context within the surrounding text or using a <figure> and <figcaption> combination.

Alternative Text Writing Tips

When crafting alternative text, consider the following:

  • Convey the intent, purpose, and meaning of the image.
  • Avoid redundant phrases like "image of" or "picture of."
  • Keep it concise but informative, typically under 125 characters.
  • Ensure it complements the surrounding content without duplicating information.

Other resources

Below are some other resources you can check when dealing with image alt text approaches.

Other Rules

Interested in other web accessibility rules? Please see these other rules: