Part of being an exceptional web developer is making your site accessible to users of all backgrounds. Specifically, visually impaired users require more support from your web page so that they can experience the content on your page.
HTML helps support visually impaired users with the
alt attribute is applied specifically to the
<img> element. The value of
alt should be a description of the image.
<img src="#" alt="A field of yellow sunflowers" />
alt attributes also serves the following purposes:
If an image fails to load on a web page, a user can mouse over the area originally intended for the image and read a brief description of the image. This is made possible by the description you provide in the
Visually impaired users often browse the web with the aid of of screen reading software. When you include the
alt attribute, the screen reading software can read the image's description outloud to the visually impaired user.
Note: If the image on the web page is not one that conveys any meaningful information to a user (visually impaired or otherwise), the
alt attribute should not be used.