Complex images contain substantial information – more than can be conveyed in a short phrase or sentence. These are typically:
- graphs and charts, including flow charts and organizational charts;
- diagrams and illustrations where the page text relies on the user being able to understand the image;
- maps showing locations or other information such as weather systems.
In these situations a two-part text alternative is required. The first part is the short description to identify the image and, where appropriate, indicate the location of the long description. The second part is the long description – a textual representation of the essential information conveyed by the image.
In certain situations the composition of the image may also be needed as part of the long description, but only where it’s important that the user understand the image construction. This page shows several possible approaches that can be used to provide both short and long descriptions.
Also it’s good practice to refer to more complex images from the accompanying text to describe the overall data, for example: “The following graph shows that visitors were lost in the first quarter, but the numbers recovered in the second quarter”.
Image containing substantial information
This bar chart of website visitor statistics has a short description of “Bar chart showing monthly and total visitors for the first quarter 2014 for sites 1 to 3” provided through the alt attribute of the image. The long description provides detailed information, including scales, values, relationships and trends that are represented visually. For example, since the declining values for site 1, consistent values for site 2, and increasing values for site 3 are highlighted through the bar chart, this information must also be included in the long text description.
Providing a link to the long description via longdesc
longdesc attribute contains the URI of a page containing the long description.
If the long description is published within an HTML element on the same page as the image, the
longdesc value can simply contain a fragment identifier (“hash link”) to the element containing the long description. This fragment identifier consists of an
# and the value of the
id attribute of the longdescription element.
Note: Both Firefox and Chrome browsers are working on implementations that will make the longdesc linked long description location reachable by all users. Currently, and in other browsers, it’s only available to screen reader users.
A text link to the long description adjacent to the image
This approach provides a text link next to the image. The link text makes both the destination and the association with the image clear.
Note: This approach is well supported in all browsers and ensures that everyone has access to the data as well as the image, no matter what browser or assistive technologies they may use.
Describing the location of the long description in the
If the long description is on the same page as the image and its location can be accurately pinpointed by being described, the
alt attribute can include location information.
Structurally associating the image and its adjacent long description (HTML5)
<figure> element can be used to enclose both the image and its long description. The long description (presented as headings, text, and a table) is explicitly associated to the image by using
role="group" on the containing
Structurally associating image and long description with
aria-described-by attribute can be used to link the description to the image. The value of the attribute is the
id of the element with the description.
Related WCAG2.0 resources
- G73: Providing a long description in another location with a link to it that is immediately adjacent to the non-text content
- G74: Providing a long description in text near the non-text content, with a reference to the location of the long description in the short description
- G92: Providing long description for non-text content that serves the same purpose and presents the same information
- G95: Providing short text alternatives that provide a brief description of the non-text content
- H45: Using longdesc