/
Alternative Description for Images and Images of Text

Alternative Description for Images and Images of Text

 

Table of Contents

Overview

Provide meaningful alternative description/text for images. This helps users who rely on assistive technology such as a screen reader to understand the meaning of the image.

The screen reader will read out the ALT description to the user.  

Example:

  • <img src="womens_history_month_hero_image.png" alt="View the 2019 Women's History Month Opening Ceremony">

  • In this case the screen reader will announce the image as follows “View the 2019 Women's History Month Opening Ceremony"

General Guidelines

Screen reader users should be provided with meaningful alt text for non-decorative images.

Screen reader users should be able to bypass decorative images that have no meaning.

Text should be used to convey information rather than images of text.

Enable people who require a particular visual presentation of text to be able to adjust the text presentation as needed.

Images that Have Meaning

A non-decorative image is a graphic that has meaning.

It could include important text that needs to be conveyed to a screen reader user who is unable to see the image. 

For example a department logo where the department name is part of the image.

Here the department name is part of the image.

The ALT text for this image should be:

<img src="sfhsa-logo.svg" alt="San Francisco Human Services Agency">

Decorative Images

Decorative images that don’t present important content or text should have null/empty alt text. Or in the event that ALT text is redundant.

Screen readers will ignore and bypass these images all together. 

Example of Decorative Images:

decorativeimages.png

Code Example: <img src="images/icons.png" alt="">

SVG Images

Provide screen reader users with alternative text for Scalable Vector Graphics (SVGs).

Example - Basic Non-Inline SVG Images:

In this case the role=”img” attribute is used to let screen reader users know that it’s an image.

An alt attribute is also included in the image tag.

<img role="img" src="images/logo.svg" alt="San Francico Arts Commission" />

Example - Inline SVG Images:

When using inline SVG images you also need to include a <title> attribute that serves as the alternative text instead of an alt attribute