JavaScript is required

Alternative text - digital guide

What is alternative text, why it's important and examples of proper use.

What is alternative text?

Alternative text provides a textual alternative to non-text content in web pages, such as photographs, logos and other images.

Alternative text serves several functions:

  • It's read by screen readers in place of images so the content and function of the image are accessible to people with visual or certain cognitive disabilities.
  • It's displayed in place of the image in browsers if the image file is not loaded or when the user has chosen not to view images.
  • It provides a semantic meaning and description for images that can be read by search engines or be used to later determine the content of the image from page context alone.

Do not use alternative text to describe decorative elements or visual elements that are not not important to the page content. You don't need to provide alternative text to describe a visual pattern, colour or visual style of a site element (such as a navigation element). For these elements leave the ‘alt attribute’ of the image blank.

All of these functions are important so you must provide alternative text wherever practical.

Alternative text can be presented in two ways:

  • within the alt attribute of the img element (in code) – this will be picked up by screen readers but invisible to the majority of page visitors
  • within the context or surroundings of the image itself – this may be in the form of an image caption, for example

Using an image caption instead of using an ‘alt attribute’ may be more appropriate in some contexts. For example, a photo within an article.

When using a caption it’s important not to duplicate the alternative text so the ‘alt attribute’ should be left blank in this case.

In many cases using a caption won't be possible, so an ‘alt attribute’ must be used.

Examples of proper use

Example 1: Photos

Photograph of a large, diverse group of cheering students, standing up and fist-pumping on the bleachers of a basketball game.

With an image or photograph it is good to explain the scene in detail while also keeping the description short.

You don't need to state that it is an image because screen readers make the user aware of this automatically. You may, however, state whether the image is a photograph or illustration if it’s important for the user to know.

The mood, or tone, of the image should also come across in the explanation if it's important to the user’s understanding. In this example, the diversity of the crowd, the excitement of the scene and the emotions of the people in the photo are integral to the user’s understanding so it’s important to make note of them.

Good alternative text example:

'Photograph of a large, diverse group of cheering students, standing up and fist-pumping on the bleachers of a basketball game.'

Bad alternative text example:

'Image of a crowd at a basketball game.'

Example 2: Logos

Regional Development Victoria logo

There is no need to state that this is a logo. However the company or department name must be used.

When an image is also a link, screen readers will make this clear to the user, so there's no need to state that it's a link. However, it is important to indicate where the link will take users. In this case it will take users to the homepage of the website.

Good alternative text example:

'Regional Development Victoria. Homepage.'

Bad Alternative text example:

'Site logo. Click this link to go to the homepage.'

Further reading and resources

Updated

Join the conversation on digital

Get advice and share your insights with other digital practitioners. Join the Single Digital Presence Community of Practice(opens in a new window).