Live Preview
An image figure with a visible caption below the media:

By the end of this tutorial, you’ll add accessible, visible captions to images and media with semantic HTML.
In HTML, the <figcaption> tag associates a caption with content inside a <figure> element. This guide covers syntax, attributes, accessibility, and best practices for beginners and web developers alike.
Place <figcaption> inside <figure>.
Label photos, charts, and diagrams for every visitor.
Describe embedded videos and other media blocks.
Style captions with class, id, and more.
Center, italicize, or brand your caption text.
Pair figcaption with proper alt text on images.
<figcaption> Tag?The figcaption element (<figcaption>) defines a caption or legend for the content encapsulated within a <figure> element. It enhances accessibility and context for images, diagrams, videos, code listings, and other self-contained media.
figcaption is only valid as a direct child of figure. Never place it outside a figure or nested inside unrelated elements.
Unlike the table caption element, figcaption is part of the HTML5 figure model. Browsers render it as normal text below (or above) the figure content, and you can style it freely with CSS.
Place <figcaption> as a direct child of <figure>, either before or after the media:
<figure>
<!-- Your content goes here -->
<figcaption>Your Caption Here</figcaption>
</figure>figcaption must be a direct child of figure.figure may contain one figcaption element.| Pattern | Code Snippet | Notes |
|---|---|---|
| Image caption | <figure><img><figcaption> | Most common pattern |
| Video caption | <figure><video><figcaption> | Describes media context |
| Caption first | <figcaption> before content | Valid HTML5 order |
| Styled caption | class="image-caption" | CSS hook on figcaption |
| Parent element | <figure> | Required wrapper |
| Default style | Plain text | No browser default italics |
<figcaption> vs altBoth relate to images, but they serve different purposes:
| Feature | <figcaption> | alt attribute |
|---|---|---|
| Visibility | Visible caption on the page | Hidden text for assistive tech |
| Element type | HTML element inside figure | Attribute on img |
| Length | Can be a full sentence or paragraph | Keep short and functional |
| Accessibility | Announced with figure content | Replaces image when not displayed |
<figcaption> and <figure>These elements work together as a labeled media unit:
| Element | Role | When to use |
|---|---|---|
<figure> | Self-contained content block | Wrap images, videos, diagrams, code snippets |
<figcaption> | Caption or legend | Describe what the figure shows |
| Together | Labeled figure | Articles, tutorials, galleries, documentation |
| Without figure | Invalid pattern | figcaption requires a figure parent |
The <figcaption> tag has no tag-specific attributes. Use global attributes to style and identify captions:
class GlobalCSS hook for caption typography, alignment, and color.
class="image-caption"id GlobalUnique identifier for linking or scripting the caption.
id="figure-1-caption"lang GlobalLanguage of the caption when it differs from the page.
lang="es"title GlobalAdvisory tooltip on hover for extra context.
title="Photo credit"<figure class="image-container">
<img src="your-image.jpg" alt="Description of the image">
<figcaption class="image-caption">A beautiful sunset</figcaption>
</figure>Global attributes apply to figcaption itself—they are not inherited from the parent figure.
Image captions, video descriptions, and styled figcaption patterns with copy-ready code and live previews.
An image figure with a visible caption below the media:
One of the primary use cases for <figcaption> is providing captions for images inside figure.
<figure>
<img src="your-image.jpg" alt="Description of the image">
<figcaption>A stunning landscape captured at dawn</figcaption>
</figure>Use <figcaption> for photo credits in articles, chart labels in reports, video titles in tutorials, diagram explanations in documentation, and gallery thumbnails where the caption adds context beyond a short alt text.
When embedding videos inside figure, <figcaption> provides additional context for all visitors:
<figure>
<video controls>
<source src="tutorial.mp4" type="video/mp4">
</video>
<figcaption>An informative tutorial on HTML5 features</figcaption>
</figure>Apply a class to figcaption for italic captions, custom colors, or alignment that matches your design system.
<figure class="image-container">
<img src="your-image.jpg" alt="Description of the image">
<figcaption class="image-caption">A beautiful sunset</figcaption>
</figure>Captions have no strong browser defaults. Style them to match your layout:
font-size Smaller caption texttext-align Center under imagesfont-style Italic photo creditscolor Muted secondary tone/* Figure caption styling */
figure figcaption {
margin-top: 0.5rem;
font-size: 0.875rem;
color: #64748b;
text-align: center;
}
figcaption.image-caption {
font-style: italic;
font-weight: 500;
}Live styled figcaption
Captions improve clarity for everyone when used correctly:
figure before adding figcaption.figcaption does not replace the alt attribute on img.Place an image, video, or diagram inside figure.
Insert figcaption as a direct child with descriptive text.
Media and caption display as one self-contained figure block.
Readers understand images and videos in context without guessing.
The <figcaption> element is fully supported in all modern browsers and Internet Explorer 9+.
From legacy Internet Explorer to the latest mobile browsers — figcaption is a safe HTML5 building block for labeled media.
Bottom line: Ship semantic figure captions with confidence. The <figcaption> element is safe to use in every production environment today.
Mastering the <figcaption> tag empowers web developers to provide meaningful context and improve the accessibility of multimedia content. Whether you are captioning images, videos, or diagrams, integrating figcaption inside figure enhances the overall user experience.
Always pair figcaption with a proper figure wrapper, keep image alt text in place, and use CSS classes for consistent caption styling across your site.
figcaption as a direct child of figurealt on images alongside figcaptionfigurealt with a caption alone<figcaption>Bookmark these before you ship — they’ll keep your media captions semantic and accessible.
<figcaption> labels content inside figure.
Caption must be a direct child of figure.
StructureVisible caption complements, not replaces, alt text.
AccessibilityWorks with images, videos, and diagrams.
Use CaseStyle size, color, and alignment freely.
StylingHTML5 semantic element with full browser support.
Compatibilityfigure element, such as an image, diagram, or video.alt describes the image for assistive technology. figcaption is a visible caption that adds context for all users.figure, either before or after the media content.class, id, lang, and title.Add figcaption inside figure for images and videos in the interactive HTML editor.
6 people found this page helpful