Ensure that figures include a caption that identifies their purpose.
Techniques
Provide a caption. [[WCAG-1.3.1]]
Examples
Explanation
Figures can take many forms, from images to charts to tables to code snippets and on. Their central
characteristic, however, is that they are secondary to the primary narrative (i.e., a figure does
not have to be immediately read in order to follow the text). If images, charts and similar content
is part of the priamry narrative, do not enclose it in figure tags.
Figure content is encapsulated in the HTML figure element, which also allows a
descriptive caption to be associated with the content using the figcaption element.
As captions are often placed after the content of the figure, readers in the past have often had no
context for the figure until reaching the descriptive text that followed the image or table. The
figcaption element now allows assistive technologies to announce the caption as
soon as the reader enters the figure.
Note that the figcaption element must be the very first or last in the
figure.
Note
Providing a caption is not a substitute for making the content within the figure accessible.
Refer to the image descriptions and table basics knowledge base pages for more information
on accessible practices for the most common types of figure content.