While you may browse a website and be able to view images with ease, this is not the case for website visitors with low vision or blindness.
Text alternatives are an integral part of the Website Content Accessibility Guidelines (WCAG) and should be a key consideration when remediating your website.
Text alternatives are alternative output formats for non-text content. Alternatives could include:
These alternatives ensure that users with low vision or blindness can still understand and engage with media on your site.
Here are the success criteria you would need to meet for alternative text in order to achieve Level A or higher.
Any non-text content, such as images or videos, that is presented to a user should automatically have a text alternative. The text alternative helps a user understand what’s on screen, ensuring they can fully engage with the content on a page.
For example, an image of a white cat could have the following alternative text, which is embedded in your HTML code:
<img src=”white_cat.Jpeg” width=”145″ height=”126″ alt=”White Persian Cat”>
This alternative text is then relayed back to a user in their preferred format with the help of assistive technology.
Alternative text requirements go beyond just images, though, and will apply in the following circumstances too:
Time-based media refers to any pre-recorded audio and video content that’s present on your website. For any audio or video content that isn’t a media alternative for text and is appropriately labeled, the following steps should be taken to achieve a specific WCAG level:
Level A
Level AA
Level AAA
Alternative text will always be required to meet the minimum WCAG requirements. However, to achieve Level AA, which is what most businesses should be aiming for, here are some best practices you can apply.
Write for the user first. Alternative text is designed to help disabled users better understand what’s on your site. While your alternative text can contain keywords where possible, you should rather be describing an image to benefit the user.
Make it specific. There is no need to make alternative text overly descriptive unless it makes sense to do so. Always aim to make it specific and only add in extra details if you really need to – 125 characters or less is ideal.
Check for spelling errors. Alternative text that contains spelling errors can create a confusing experience for your users when it’s read back to them.
Use null alt tags. For any images that are used for formatting or decorative purposes, make sure that you include a null alt tag. This indicates to assistive technology that it can be ignored.
The tag will look like this: <img src=”black_line.png” alt=””>
Clear, simple language is key. When creating captions for video content, keep your language clear and simple. It’s also important to keep any international viewers in mind. Would they still be able to understand your captions based on the language you’re using?
Not all sounds need captions. Captions should only be paired with the most important audio in your videos. Basic background noises that wouldn’t provide any context don’t need to be captioned.
Alternative text should convey the purpose of an image and be linked to the content on your page. Make your text concise and use clear, simple language to ensure anyone can understand it. Alternative text should never be longer than 125 characters.
Any images that are used to format or decorate your website do not require alternative text. However, blank alt tags should still be added to your HTML code to ensure assistive technology ignores them. The alternative is that assistive technology will read the file name, creating a poor user experience.
If it makes sense to the image you’re describing, it helps to add color descriptions to your alternative text. For example, perhaps you have a specific product available in different colors. In this instance, it makes sense to add colors to the description.