Alternative (alt) text for Media
When writing alternative text, the first question you should ask yourself is, "Should I write anything at all?"
What is alternative text?
Alternative text (also known as "alt text") provides a textual alternative for media items such as images, audio, and video, and for visually complex content such as tables, charts, and graphs. So, if an image does not load, for example, this is the text that will be displayed in its place. Additionally, this is the text that will be provided to assistive technologies, making it a vital part of accessibility for the site.
What should I write for alt text?
If your media item contains pictures of text or other important information, you'll want use alt text to explain its importance.
However, if it is simply decorative, that is, the image doesn't add pertinent information, don't add any alt text. When adding an image or other media to the media library on your Stanford site, that's the equivalent of leaving the Alternative text field blank. When the page renders, it will render it as alt="" .
Use people's names
When uploading profile and other images of people photos, if alt text is needed, use the person's name for the alt text.
Identify complex images and describe elsewhere
Alt text may not be enough. Complex images like graphs, charts, diagrams, illustrations, and maps require a two-part text alternative.
The first part is the short description to identify the image and, where appropriate, indicate the location of the long description. The second part is the long description – a textual representation of the essential information conveyed by the image.
There are several different approaches that can be used to provide short and long descriptions. Learn more about how to make complex images accessible and see examples.
Think about using captions
If the information you want to convey would be useful for all users, consider using captions.
Alt text explains information in images for screen reader users. Captions describe images to help users relate them to surrounding text.
-- From the Australian Government Style Manual
Rather than providing a detailed description of an image or other media in the alt text, limit the alt text to describing what you see. Then, provide your description of the image and how it relates to your message in a caption or in text visible elsewhere on the page. This allows all site visitors access to the same information.
To share or not to share?
Just as an image or other media on your Stanford site can be shared in several places on your site, the alt text is also shared.
Before adding existing media such as an image to a page, you’ll want to make sure the alt text matches its context. If the existing alt text does not match the image context, you’ll need to upload the image again and add the appropriate alt text.
To see the alt text for a media item
- In the admin menu go to All Content > All Media > Media Library and search for your image
- Click on the pencil icon to bring up the edit page for the image
On the edit page for the media item you can change the Name and Alternative text for the image. If it is already in use, a Drupal message will give the number of times the image is in use.