Figure and caption (figure-figcaption)

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


Figcaption not first or last child:

In this example the <figcaption> is placed between other children of <figure>. Per the HTML content model, if a <figcaption> is present, it must be the first or the last child of its parent <figure>.


A network diagram
Diagram showing network connections.

Additional notes about the diagram.


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

Note: Possible to automatically test/detect. For each <figure> that contains a <figcaption>, verify the <figcaption> is either the first or the last element child of the <figure>.

axe detected: none  |  QualWeb detected: none