Detailed answer
Figure groups self-contained illustrative content with an optional caption.
It may hold an image, diagram, or code listing. Figcaption provides context, while a meaningful image still needs suitable alternative text. Write the caption and alt text to complement each other rather than repeating the same sentence unnecessarily.
Example
<figure><img src="tree.png" alt="HTML branches into head and body"><figcaption>A basic document tree.</figcaption></figure>
Understanding the behavior
Figure groups self-contained material with an optional caption. The caption describes that group, while image alternative text addresses the image's role for someone who cannot see it. These two texts may complement rather than duplicate one another.
Practical implementation notes
If the image is a chart, provide the important conclusion and a way to access the underlying data. A caption alone may not communicate every relationship visible in a complex graphic.
How to check it
Read the caption and alt text together and remove unnecessary duplication.
Expected result
The caption gives context while alt conveys the diagram's essential visual information.
Watch out: A caption is not automatically a replacement for alt text.
Read the reference ↗