<figcaption>
The caption of an illustration inside a `<figure>` element.
- Display
- block
- Closing tag
- Required
- Permitted content
- Flow content
Example
#<style>
figcaption { margin-top: 6px; font-size: 0.875em; opacity: 0.75; }
</style>
<figure>
<img
src="/collections/covers/darmowa-nauka-programowania.webp"
alt="A boy with glasses studies at night in a library, with a laptop showing code and open books in front of him"
width="300"
height="200"
>
<figcaption>Photo 2. A library is still a great place to learn, including programming.</figcaption>
</figure>Definition and usage
#The <figcaption> element contains a caption or legend for the content of a <figure> element: a photo description, the number and title of a figure, the source of the data in a chart, the author of a quote. It must be the first or the last child of the <figure>.
The caption is visible to all users and describes the illustration in the context of the text, for example βFig. 2. Growth in the number of students in 2026β. Assistive technologies use it as the name of the whole illustration.
Any flow content can go inside: paragraphs, a link to the source, even a short list. By default it is a plain block with no emphasis, so you set a smaller font or italics in CSS.
Syntax
#<figcaption>Caption text</figcaption>Attributes
#This element has no attributes of its own. It supports the global attributes, such as class, id and hidden.
Default CSS
#Most browsers display this element with these default styles:
figcaption {
display: block;
}Browser support
#Widely available
Works in all modern browsers, phones included. You can use it without worry.
- Chrome
- Edge
- Firefox
- Safari
Good practices
#- A single
<figure>can have only one<figcaption>. - Donβt use
<figcaption>outside a<figure>. A table caption is the job of<caption>, and a plain description under an image without a<figure>is just a paragraph.
Related entries
#- <figure>A self-contained illustration with an optional caption: an image, chart, code snippet, or quote.
- <img>An image embedded in the page.
- <caption>The title of a table, placed as the first element inside `<table>`.
- <picture>A container for several versions of an image. The browser picks the one that best fits the screen and format.
Practise it in lessons
#Spotted a mistake or missing an example? Write to us.