Figure and caption (figure-figcaption)

Ensure captioned images and diagrams are marked up with a <figure> element containing a <figcaption>.


Caption text outside figure:

In this example a <figure> is present, but the text that serves as the caption is placed outside the figure instead of inside a <figcaption>.


A network diagram

Diagram showing network connections.


<figure>
  <img src="../../../assets/images/diagram.png" width="500" alt="A network diagram" />
</figure>
<p>
Diagram showing network connections.</p>

Note: Impossible to automatically test/detect. Requires a human tester or AI to determine whether nearby text is intended to be a caption; automated tools can only flag <figure> elements that lack a <figcaption>.

axe detected: none  |  QualWeb detected: none