Web Accessibility Training

Alt text

What is alt text for images?

Alt text is short for 'alternative text'. It's a short piece of text that accompanies a webbed image. It's not usually visible on a webpage but is embedded in the page's code. In T4, each media library image is stored with its own alt text.

How alt text is used

Alt text communicates the meaning or function of an image to those who can't see it.

It's used by assistive technologies that announce it audibly, or communicate it through a braille reader, to the user. If an image fails to load on a webpage for any reason then the image's alt text will automatically display instead.

Types of alt text

Alt text is commonly thought of as a description of the image, but there are actually five types:

  • Decorative: blank.
  • Descriptive: briefly describes the image – the most common type.
  • Labelled: labels the image so that a longer description elsewhere can refer to it.
  • Referential: provides a short description and indicates the location of a longer description.
  • Functional: states what happens or which page will load when someone clicks on the image.

Which type of alt text to use

The type of alt text that an image needs is determined by a combination of factors:

  • What the image depicts.
  • Whether the image is clickable...
    • and it's accompanied by link text, or not...
      • and it depicts something that adds meaning to that link text, or not.
  • Whether the image contains meaningful text.
  • Whether the image matches the definition of an 'image of text'.
  • The surrounding content on the page (or host page in the case of modals).
  • The language of the page.
  • Whether the image can be described within alt text limits or needs a long description option.
  • The way that the T4 template codes the image.

You don't need to understand, learn or remember these factors. They're simply listed to explain why it's normal for the same image to need different alt texts when used for different purposes.

It's a common misconception that once an image has been given alt text then it doesn't need to be considered again, but this isn't true. Image alt text should be considered, at least briefly, every time you add an image to a page, even if it already has alt text in the media library, as it may not be correct for your intended use.

The procedure for adding images will guide you through which alt text to use for your image.