The <figure> element groups self-contained media — an image, chart, code block or quote — with an optional caption via <figcaption>. It semantically links the media to its description.
figure and figcaption
<figure><img src="chart.png" alt="Sales grew 40% in Q3" /><figcaption>Figure 1: Quarterly sales, 2026.</figcaption></figure><figure><blockquote>The web is for everyone.</blockquote><figcaption>— Tim Berners-Lee</figcaption></figure>
Key takeaways
- 01<figure> groups self-contained media (image, chart, quote, code) with a caption.
- 02<figcaption> provides the caption.
- 03The caption differs from alt text: alt describes the image; the caption adds context for all.
- 04Use it for content referenced from the main flow but relocatable.
