{"data":{"slug":"github-thedaviddias-front-end-checklist-skills-figure-figcaption-b350a872b086","title":"Implement <figure> and <figcaption> for Image Captions","summary":"Wrap images and their captions in <figure> and <figcaption> elements to ensure accessibility and semantic correctness. This includes positioning <figcaption> as the first or last child of <figure> and ensuring the alt attribute is concise or empty when the figcaption fully describes the image.","url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-figure-figcaption-b350a872b086","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-thedaviddias-front-end-checklist-skills-figure-figcaption-b350a872b086","markdown_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-figure-figcaption-b350a872b086.md","download_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-figure-figcaption-b350a872b086\/download","category":{"slug":"content-editorial","name":"Content & Editorial"},"editor_note":"Before implementing, ensure that the <img> alt attribute is reviewed and adjusted if the <figcaption> fully describes the image for both sighted and screen reader users. The corrected HTML should be shown after applying the changes.","instructions":"---\nname: figure-figcaption\ndescription: \"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.\"\nmetadata:\n  category: images\n  priority: medium\n  difficulty: beginner\n  estimatedTime: \"10\"\n  source: frontendchecklist.io\n  url: https:\/\/frontendchecklist.io\/rules\/images\/figure-figcaption\n---\n\n# Use <figure> and <figcaption> for image captions\n\nUsing 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.\n\n## Quick Reference\n\n- Wrap image + visible caption pairs in `<figure>` with `<figcaption>` as a direct child\n- `<figcaption>` must be the first or last child of `<figure>`\n- Do not duplicate alt text in figcaption\u2014alt is the fallback, figcaption is the visible description\n- `<figure>` is appropriate for images, code blocks, diagrams, and charts\u2014not every image\n\n## Check\n\nScan 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\u2014they serve different purposes. Flag any <img> followed by descriptive text that is not structured as figure\/figcaption.\n\n## Fix\n\nFor 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\u2014if 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.\n\n## Explain\n\nExplain 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.\n\n## Code Review\n\nReview 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.\n\n---\n\nFor full implementation details, code examples, and framework-specific guidance,\nsee `references\/rule.md`.\n\nRule page: https:\/\/frontendchecklist.io\/rules\/images\/figure-figcaption\n","use_cases":["Fixing image captions that use <p> or <span> tags instead of <figcaption>","Improving accessibility for screen readers by associating captions with images","Enhancing SEO by properly marking up image descriptions"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/thedaviddias\/Front-End-Checklist\/blob\/e8d14d049010e2ce25afcd5e8609dfcbbe63e47e\/skills\/figure-figcaption\/SKILL.md","source_commit":"e8d14d049010e2ce25afcd5e8609dfcbbe63e47e","license":null,"version":null,"listing_approved_at":"2026-11-23","created_at":"2026-11-22T16:07:29.000000Z","updated_at":"2026-11-23T04:55:09.000000Z","seo_title":"Implement <figure> and <figcaption> for image captions","seo_description":"Use <figure> and <figcaption> for image captions to improve accessibility and SEO. Learn how to structure captions properly.","seo_keywords":["image caption markup","accessibility image captions","semantic image captioning","SEO image captions","figure and figcaption usage"]}}