A figure pairs a small inline SVG illustration with a figcaption so the media and caption stay connected.

Program

Figures are useful when media and explanatory text belong together. The SVG gets its own name, and the figcaption explains the whole figure.

figure_caption_media.html
Visuals: captured from real browser rendering
<figure class="media-figure">
  <svg role="img" aria-labelledby="chart-title" viewBox="0 0 80 40">
    <title id="chart-title">Tiny bar chart</title>
    <rect x="8" y="18" width="14" height="14"></rect>
    <rect x="32" y="10" width="14" height="22"></rect>
    <rect x="56" y="4" width="14" height="28"></rect>
  </svg>
  <figcaption>Three bars compare weekly signups.</figcaption>
</figure>
<style>
  .media-figure { border: 1px solid #94a3b8; padding: 12px; max-width: 16rem; }
  .media-figure svg { width: 100%; height: auto; fill: #0f766e; }
</style>
  1. Create the figure wrapper.

    The SVG and caption are grouped as one figure.
    The SVG and caption are grouped as one figure.
  2. Connect the SVG name.

    The SVG points to a title for its accessible name.
    The SVG points to a title for its accessible name.
  3. Name the SVG illustration.

    The inline SVG has a short text name.
    The inline SVG has a short text name.
  4. Add the figure caption.

    The caption explains what the figure represents.
    The caption explains what the figure represents.
  5. Render the figure card.

    The figure has a visible card boundary and padding.
    The figure has a visible card boundary and padding.
  6. Check SVG scaling.

    The SVG scales to the figure width while keeping its caption attached.
    The SVG scales to the figure width while keeping its caption attached.
figure figure groups media with related explanatory text.
svg title An inline SVG can have an accessible name through title and aria-labelledby.
figcaption figcaption gives the figure a visible caption.