<figcaption>

The caption of an illustration inside a `<figure>` element.

Display
block
Closing tag
Required
Permitted content
Flow content
On this page

Example

#
HTML
<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>
Preview

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

#
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:

CSS
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

#

Practise it in lessons

#

Spotted a mistake or missing an example? Write to us.