Text Content

HTML <figure> element

Groups self-contained material, optionally with a caption. It can contain diagrams, code, photographs or other referenced content. Use a figure for material that can be referenced from the surrounding discussion and understood as a unit. It need not contain an image; a code listing can also be a figure. It accepts global HTML attributes; individual global features may be inapplicable or restricted.

Formal Syntax & Structure

html syntaxhtml
<figure>Content</figure>

Return Value

HTMLElement

Content model: Flow content with an optional figcaption as first or last child.

Working Example

Example Snippethtml
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>HTML example</title></head><body><figure><pre>2 + 2 = 4</pre><figcaption>A calculation</figcaption></figure></body></html>
HTML Reference