Write alt texts for images
Images and illustrations are important complements to text, as many people prefer visual communication to reading text. But not everyone can see images, and therefore we must describe all images with an alternative text, or alt text.
The alt text is a short written text description of an image that can't be viewed by the user, for example a visually impaired person using a screen reader, or users who choose to turn off image presentation. The alt text of the image is displayed - or read by the screen reader - when the image can't be viewed.
Why a good alt text is important
- Screen readers read out the alt text for the user
- If the image has no alt text, the user will be informed that there is an image, but not what it contains
- Also those who choose to disable images in their browser will be able to read the alt texts
- Bonus: Alt texts help search engines find content in pages
Write alt texts based on the purpose of the image
Keep the purpose and complexity of the image in mind when you write the alt text:
Informative images
Add a short description of the information
For images presenting concepts and information - typically pictures, photos, and illustrations - the alt text should be a short description conveying the essential information presented by the image.
Complex images
Add a complete text description
If the image is a chart, diagram, or illustration, consider how to convey the information contained in the image using both the alt text and placing more extensive text about the image in the page.
Groups of images
Describe one of the images
If multiple images convey a single piece of information, the alt text for one image should convey the information for the entire image group.
Images for decoration only
Mark the image as decorative
If an image truly doesn't convey any meaning or value and is just there for design purposes, you can mark it as decorative instead of adding an alt text.
How alt texts work in AEM
Alt texts are automatically picked from Assets
The alt text for an image stored in Assets (DAM) is displayed in all components where the image is used. If there is no Swedish alt text for the image, the English alt text will be displayed. If you switch to another image in the component, the new image alt text will be picked from Assets automatically.
You can enter a custom alt text for an image in a certain component
If you want to use a specific alt text for an image in a certain place, you enter the text in the Alternative text field in the page component. This custom alt text will override the general alt text in this component, but it will not change the general alt text in Assets.
Group Brand images
- The Group Brand images in Assets (Global folder) have both English and Swedish alt texts.
- The Swedish alt text will be displayed on Swedish sites, while the English alt text will be displayed on English sites (including Norway and Denmark). In Norwegian and Danish sites the alt text can be changed to local language on component level.
- If you want to change the alt text on Group Brand's images to a custom alt text you do it in the component, not in Assets.
Images you upload yourself
- For each image you upload to Assets, you need to add an alt text in Assets yourself. The alt text is added in the properties for the image.
- As English alt texts are mandatory you need to fill it in, also if your site is in Swedish or other local language.