Decorative images don’t add information to the content of a page. For example, the information provided by the image might already be given using adjacent text, or the image might be included to make the website more visually attractive.
In these cases, a null (empty)
alt text should be provided (
alt="") so that they can be ignored by assistive technologies, such as screen readers. Text values for these types of images would add audible clutter to screen reader output or could distract users if the topic is different from that in adjacent text. Leaving out the
alt attribute is also not an option because when it is not provided, some screen readers will announce the file name of the image instead.
Whether to treat an image as decorative or informative is a judgement that only the author can make, based on the reason for including the image on the page. Images may be decorative when they are:
- Visual styling such as borders, spacers, and corners;
- Supplementary to link text to improve its appearance or increase the clickable area;
- Illustrative of adjacent text but not contributing information (“eye-candy”);
- Identified and described by surrounding text.
The examples below show how to use the
alt attribute when decorative images are provided using the
<img> element. Where possible, decorative images should be provided using CSS background images instead.
Image used as part of page design
This image is used as a border in the page design and has a purely decorative purpose.
Screen readers also allow the use of WAI-ARIA to hide elements by using
role="presentation". However, currently this feature is not as widely supported as using a null
Note: If the image was used to indicate a thematic break, e.g. a scene change in a story, or a transition to another topic, using the
<hr> element would be appropriate to notify assistive technology.
Decorative image as part of a text link
This illustration of a crocus bulb is used to make the link easier to identify and to increase the clickable area, but doesn’t add to the information already provided in the adjacent link text (of the same anchor). In this case a null (empty)
alt value should be used for the image.
Image with adjacent text alternative
This picture of a sleeping dog is already sufficiently described by the adjacent text. There is no need to repeat this information and a null (empty)
alt value can be used for this image.
Image used for ambience (eye-candy)
This image is used only to add ambience or visual interest to the page.
Note: If the purpose of this image was to identify a plant or convey other information, rather than to just improve the look of the page, it should probably be treated as informative. The author determines the purpose for the use of the image.
Related WCAG 2.0 resources
The following WCAG 2.0 resources are directly related to this page. Relationship to WCAG 2.0 provides more background information.