alt
The alt attribute provides alternative text describing an image for accessibility and when the image fails to load.
Syntax
alt="description" Examples
<img src="/team.jpg" alt="Five engineers smiling at a whiteboard">
<img src="/divider.png" alt="">
Output
The first image is announced by screen readers; the second is ignored as decorative due to the empty alt.
Notes
Always include alt. Use a concise meaningful description for informative images and alt="" (not omitted) for purely decorative ones so assistive tech skips them.
Browser & runtime support
| Environment | Since version |
|---|---|
| chrome | 1.0 |
| firefox | 1.0 |
| safari | 1.0 |
| edge | 12 |