Aller au contenu
Skillpedia
Sites et interfaces (frontend)75k · #2843

figure-figcaption

Ce qu’il fait

Cette compétence vérifie que les légendes d'images d'une page sont correctement balisées. Elle s'adresse aux développeurs et aux rédacteurs qui publient du contenu avec des images.

Quand l’utiliser

  • ✓Lorsqu'une image de votre page a une légende écrite dans un simple paragraphe.
  • ✓Quand vous publiez des articles avec des photos, des graphiques ou des schémas.
  • ✓Lorsque les légendes de vos images doivent être lues correctement par les outils d'assistance.

Lien du skill

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

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/figure-figcaption/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Pouvez-vous structurer correctement les photos et leurs légendes dans mon article ?”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent repère les images accompagnées d'un texte placé juste à côté et enveloppe chaque paire dans un élément figure avec un figcaption. Il vérifie aussi que le texte alternatif n'est pas une copie exacte de la légende.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis 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

Questions fréquentes

Qu'est-ce qu'un figcaption ?

C'est l'élément HTML d'une légende, placé dans un élément figure avec son image.

Le texte alternatif doit-il reprendre la légende ?

Non. La compétence indique que le texte alternatif est une description de secours et que la légende est le texte visible, ils doivent donc être différents.

Chaque image doit-elle être dans un figure ?

Non. La compétence indique que figure convient aux contenus comme les images, les blocs de code, les schémas et les graphiques, et non à toutes les photos.

Détails

Description originale de l’auteur

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

Popularité

Étoiles GitHub
75k
Position au classement
#2843
Licence
MIT
Mis à jour
31/10/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires