Skip to main content

html-tags.com

<figure>

Self-contained content referenced from the main flow: images, code listings, tables, quotes, diagrams.

Baseline: Widely available · Grouping content

When to use it

When the content could move to an appendix without breaking the prose; caption it with figcaption.

When not to

Not every image needs a figure — only content the text refers to as a unit.

Example

console.log('hello');
Listing 1 — a captioned code sample.
<figure>
  <pre><code>console.log('hello');</code></pre>
  <figcaption>Listing 1 — a captioned code sample.</figcaption>
</figure>
Rendered live above, source below.

Authoritative references