Provide Text Alternatives for Non-Text Content
Why It Matters
People who are blind use screen readers, which read web content aloud. Screen readers cannot interpret images directly; they rely on alt text to understand the image’s content or function. Without alt text, vital information or functionality conveyed by images is lost. Users with low vision might use text-to-speech software, and users with cognitive disabilities might benefit from clear descriptions.
Fixing the Issue
Provide descriptive alt text for all informative images using the alt attribute. For complex images like charts or graphs, provide a longer description nearby or link to one. For images that are purely decorative and convey no information, use an empty alt attribute (alt=””). For functional images (like an image used as a button), the alt text should describe the action or destination (e.g., alt=”Search”).
Bad Code Example
This example shows missing or unhelpful alt text:
