HTML <figure> / <figcaption> tags
- closing tag
- required (both)
- void element
- no
- lives inside
- <body>
- typically holds
- an <img> plus a <figcaption>
Where it goes
Around the <img> and its <figcaption>, wherever the picture appears.
Example
<figure>
<img src="cat.jpg" alt="A cat">
<figcaption>My cat, Whiskers.</figcaption>
</figure>Open this example in the editor →
Common mistakes
- Using <figure> with no <figcaption>. If there is no caption, a plain <img> is simpler and just as correct.
- Putting <figcaption> in the middle. It has to be first or last inside the <figure>.
- Repeating the alt text as the caption. alt describes the picture for someone who cannot see it. The caption adds context for someone who can. Different jobs.