本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)75k · #2843

figure-figcaption

できること

このスキルは、ページの画像のキャプションが正しくマークアップされているかを確認します。写真付きのコンテンツを公開する開発者や編集者向けです。

使う場面

  • ✓画像の横にある説明が、普通の段落で書かれているとき。
  • ✓写真、グラフ、図のある記事を公開するとき。
  • ✓画像のキャプションが、支援ツールに正しく読まれる必要があるとき。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/figure-figcaption/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“記事の写真とキャプションを、正しい構造にしてもらえますか。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、すぐ横にテキストがある画像を探し、それぞれの組を figure 要素で囲んで figcaption を付けます。また、alt テキストがキャプションの完全なコピーになっていないかも確認します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)を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

よくある質問

figcaption とは何ですか?

画像と一緒に figure 要素の中に置かれる、キャプションの HTML 要素です。

alt テキストはキャプションと同じにすべきですか?

いいえ。alt テキストは代替の説明で、キャプションは目に見えるテキストなので、内容は違うべきだとこのスキルは説明しています。

すべての画像に figure が必要ですか?

いいえ。このスキルは、figure は画像、コードブロック、図、グラフなどの内容に合うもので、すべての写真に使うものではないとしています。

詳細

作者による元の説明

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

人気

GitHubのスター
75k
ランキング
#2843
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル