Provide an alt
attribute for every <img>
element. If the image fails to load, the alt text is used as a placeholder so users have a sense of what the image was trying to convey.
Most images should have short, descriptive text:
<img alt="Audits set-up in Chrome DevTools" src="...">
If the image acts as decoration and does not provide any useful content, give it an empty alt="" attribute to remove it from the accessibility tree:
<img src="background.png" alt="">
Bad
<img src="spreadsheet.png">
Good
<img src="spreadsheet.png" alt="Spreadsheet screenshot.">