×

html · level 2 · unit 4 · lesson 4

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

Tap a green word if you get lost.

meet it

pairs a picture with its <figcaption>.

A figure is something the text points to, like a photo, a chart or a map, with a caption that explains it. Wrap the <img> in <figure>, and put the caption in <figcaption>.

The caption and the alt text do different jobs. Alt text replaces the picture for someone who cannot see it. The caption adds something for everyone, such as who took the photo, or when.

Put <figcaption> first or last inside the figure, never anywhere else.

<figure>
  <img src="tree.svg" alt="A tall oak with a rope swing">
  <figcaption>The 300-year-old oak in Brook Park.</figcaption>
</figure>

Press show my page to see it here.

Browsers indent a figure on both sides, so it stands apart from the text around it.