Skip to content

<figure> - Figure with Optional Caption

Block-level HTML5

The <figure> element represents self-contained content, typically with an optional caption specified using <figcaption>. It’s commonly used for images, diagrams, code snippets, and other content referenced from the main text.

Result
<figure>
<!-- Content (image, code, diagram, etc.) -->
<figcaption>Caption text</figcaption>
</figure>

The <figcaption> element is optional and can appear before or after the content.

The <figure> element supports all global attributes like id, class, style, and lang.

<figure id="diagram-1" class="centered-figure">
<!-- Content -->
</figure>
Result
Result
Result
Result
Result
Result
Result
Result
Result
Result
Result
Result
Result
<figure>
<img src="chart.png" alt="Bar chart showing 50% increase in sales">
<figcaption>Q4 Sales Performance</figcaption>
</figure>
<figure>
<img src="process.png" alt="Flowchart">
<figcaption>
Figure 3: User authentication process showing login,
verification, and session creation steps
</figcaption>
</figure>

Screen readers announce figures with their captions:

<!-- Screen reader: "Figure. [Image description]. Caption: Product photo" -->
<figure>
<img src="product.jpg" alt="Blue widget with chrome finish">
<figcaption>Product photo</figcaption>
</figure>

Use <figure> when content:

  • Is self-contained
  • Could be moved to an appendix
  • Is referenced from the main text
  • Benefits from a caption
Result
<!-- Image is purely decorative -->
<div class="hero">
<img src="banner.jpg" alt="">
</div>
<!-- Image is part of content flow, not supplementary -->
<p>
Our logo: <img src="logo.png" alt="Company logo">
</p>
Result
Result
Result
BrowserVersionNotes
Chrome8+Full support
Firefox4+Full support
Safari5.1+Full support
Edge12+Full support
IE9+Full support

The <figure> element was introduced in HTML5.