Skip to content
Skillpedia
Websites & UI (frontend)75k · #2843

figure-figcaption

What it does

This skill checks that image captions on a page are marked up properly. It is for developers and editors who publish content with pictures.

When to use it

  • ✓When an image on your page has a caption written in a plain paragraph.
  • ✓When you publish articles with photos, charts or diagrams.
  • ✓When your image captions need to be read correctly by assistive tools.

Skill link

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/figure-figcaption/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/figure-figcaption/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Can you structure the photos and captions in my article properly?”

5 new skills a week. 1 minute to read.

How it works

The agent finds images with text placed right beside them and wraps each pair in a figure element with a figcaption. It also checks that the alt text is not an exact copy of the caption.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Use <figure> and <figcaption> for image captions

Using a <p> tag as a caption is invisible to assistive technology as an image description. The <figure>/<figcaption> pattern creates a machine-readable relationship between an image and its caption, which screen readers surface to users. It also communicates to search engines that the caption describes the image, supporting image SEO.

Quick Reference

  • Wrap image + visible caption pairs in <figure> with <figcaption> as a direct child
  • <figcaption> must be the first or last child of <figure>
  • Do not duplicate alt text in figcaption—alt is the fallback, figcaption is the visible description
  • <figure> is appropriate for images, code blocks, diagrams, and charts—not every image

Check

Scan the codebase for images with adjacent visible text that acts as a caption (e.g., a <p> or <span> immediately below an <img> describing it). Verify: 1) Such image-caption pairs are wrapped in <figure>. 2) The caption text is inside a <figcaption> element. 3) <figcaption> is a direct child of <figure>. 4) The alt text on the <img> is not identical to the <figcaption> text—they serve different purposes. Flag any <img> followed by descriptive text that is not structured as figure/figcaption.

Fix

For each image with an adjacent caption: 1) Wrap the <img> and its caption text in a <figure> element. 2) Move the caption text into a <figcaption> element inside <figure>. 3) Review the <img> alt attribute—if the figcaption already fully describes the image for sighted users, the alt can be shorter or empty (alt="") only if the figcaption alone is sufficient for screen readers too; otherwise keep a concise alt. 4) Position <figcaption> as the first or last child of <figure>. Show the corrected HTML.

Explain

Explain the semantic meaning of <figure> and <figcaption>. The <figure> element represents self-contained content (an image, code sample, diagram) that is referenced from the main content but could be moved without affecting the document flow. <figcaption> provides a caption or legend for the figure. Screen readers announce the figcaption in association with the figure, giving users context. Without this markup, sighted users see a caption but screen reader users hear only the alt text with no indication that a visible caption exists.

Code Review

Review image assets, markup, and delivery configuration related to Use <figure> and <figcaption> for image captions. Flag exact files or components where format choice, sizing, or loading behavior violates the rule, and describe how to confirm the fix in DevTools.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/images/figure-figcaption

FAQ

What is a figcaption?

It is the HTML element for a caption, placed inside a figure element together with its image.

Should the alt text match the caption?

No. The skill says alt text is a fallback description and the caption is the visible text, so they should differ.

Does every image need a figure?

No. The skill says figure suits content such as images, code blocks, diagrams and charts, not every picture.

Details

Original description by the author

Use when reviewing image assets, markup, and CDN or build transforms related to Use <figure> and <figcaption> for image captions. Check encoded size, rendered size, loading strategy, and above-the-fold impact together.

repo: thedaviddias/Front-End-Checklist

Popularity

GitHub stars
75k
Ranking position
#2843
License
MIT
Updated
10/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills