Verified Jobs Live
Web Development Medium Level ~3 min read

Why is an image alt attribute sometimes descriptive and sometimes empty?

Interactive Practice Mode
Formulate your thoughts or take notes before revealing the model solution.
Model Answer & Deep-Dive Explanation

Alte ative text conveys an image’s purpose in its current context for people who cannot perceive it. An informative chart needs an equivalent explanation, often with adjacent data for complex content. A purely decorative image should generally use alt="" so assistive technology can skip it. A linked image’s accessible name should communicate the destination or action. Avoid repeating nearby text unnecessarily or using filenames as descriptions. The correct alte ative depends on function and context, not simply on identifying every visible object in the picture.