All images that convey meaning must include an alternative method to describe an image.
Alternative text or alt text is a text replacement for an image that is used to explain what the image is and what it's trying to convey to the user. It requires using the
alt attribute on an
img element. Alternative text should briefly describe what the picture is conveying
If the image is a decorative image (background image), it does not need alternative text. All decorative images should have the “null” attribute.
The best method to provide alternative description to users is by using captions. Captions allow equal information to both sighted and assistive technology users. At times, an alternative text might provide more information to assistive technology users giving a disadvantaged to sighted users. Moreover, alternative text can be an inconvenience to assistive technology users when it becomes too long. Captions are located either below or above the image to associate the description and image.
Sentence image description
Sentence image description is another method to provide text alternatives for images. It requires including the description of the image within the context of the page. However, when the image’s description is included within the surrounding content, the user might forget the description of the image once they reach it. Specific coding methods must be used to relate the image to the description. Refer to the Best Practices for Accessible Images for more information.
Why are text alternatives for images important?
Image descriptions are essential to ensure your image is accessible to all people including people with disabilities. The image description will allow all users the ability to know what the image is about and understand additional information. Images that need text alternatives and do not have them may present barriers to people with disabilities. Image descriptions also benefit all users because they can serve as an image replacement if the image cannot be displayed on the page. For example, if a user has the images disabled on their web browser the alternative text or caption will allow them to determine what the image is about. Additionally, text alternatives can be used to help search engines identify your website easily.