Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 2.5 — Figures and Captions
HTML · Example 2 of 2

A quote and a code listing as figures

figure wraps self-contained content that the main text refers to (an image, chart, code listing or quotation), and figcaption gives it a visible caption that is tied to it in code.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 6 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Turn an image of a map with the credit "Map: OpenStreetMap contributors" into a proper figure. Use a fictional file name and good alt text.

02

Attribute this quote correctly with figure: "Talk is cheap. Show me the code." by Linus Torvalds.

Explain it without notes

01

What kind of content belongs in a figure? Give three examples that aren't photos.

02

What is the difference between an image's alt text and a figure's caption?

03

Where can a figcaption go, and how many can a figure have?

A quote and a code listing as figures

Preview

Press Run to see the page.

Console

Nothing logged yet.