Definition and Usage
To understand the <figcaption>
tag, you should first be familiar with the <figure>
tag.
Additional Explanation
The <figure>
tag represents self-contained content related to the main flow of the document, such as images, diagrams, or code blocks.
Optionally, you can use the <figcaption>
tag to add a caption (or legend) that references this content.
Basic Example
The following example clearly shows how a caption referencing the content of a <figure>
tag is represented using the <figcaption>
tag.
<p>The Earth, home to humanity, is beautiful.</p>
<figure>
<img src="earth.jpg" alt="Earth glowing blue from space">
<figcaption>Earth viewed from space</figcaption>
</figure>
The Earth, home to humanity, is beautiful.

Syntax
The parent element must be a <figure>
tag.
The following example shows a <figcaption>
tag used outside of a <figure>
tag.
<div>
<img src="earth.jpg" alt="Earth glowing blue from space">
<figcaption>Earth viewed from space</figcaption>
</div>
It is optional within a <figure>
tag.
<p>The Earth, home to humanity, is beautiful.</p>
<figure>
<img src="earth.jpg" alt="Earth glowing blue from space">
</figure>
When used inside a <figure>
tag, it must appear as either the first or last child element.
When used inside a <figure>
tag, it must appear as either the first or last child element. Positioning it this way helps users relying on screen readers or other assistive technologies to understand and interact with the page content effectively.
The following example shows incorrect usage where the <figcaption>
tag appears as the second child element.
<figure>
<img src="earth.jpg" alt="Earth glowing blue from space">
<figcaption>Earth viewed from space</figcaption>
<p>The Earth, home to humanity, is beautiful.</p>
</figure>
The <figure>
tag may include additional information about the source.
In the following example, the first <figcaption>
block provides a description and source information for the duck image. This approach allows you to structure and provide additional information related to media or informational elements on the web page.
<figure>
<img src="duck.jpg" alt="A cute duck by the lakeside">
<figcaption>
<p>This photo shows a cute duck.</p>
<p><small>Photo credit: 🌟 News</small></p>
</figcaption>
</figure>
Code Explanation
The <small>
tag is used to display side comments, legal notices, or notes in smaller text according to typographic conventions or best practices.
Technical Syntax Summary
Permitted parents | <figure>
(the <figcaption> must be the first or last child element.) |
---|---|
Permitted content | Flow content. |
Implicit ARIA role |
No corresponding role |
Permitted ARIA roles |
group , none , presentation |
Browser compatibility
Tag |
Desktop Chrome
|
DesktopDesktop Edge
|
Desktop Firefox
|
Safari
|
---|---|---|---|---|
<figcaption>
|
8 | 12 | 4 | 5.1 |
Specifications
Specification | |
---|---|
<figcaption>
|
HTML Standard #the-figcaption-element |