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.
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.
Attribute this quote correctly with figure: "Talk is cheap. Show me the code." by Linus Torvalds.
Explain it without notes
What kind of content belongs in a figure? Give three examples that aren't photos.
What is the difference between an image's alt text and a figure's caption?
Where can a figcaption go, and how many can a figure have?
Preview
Console
Nothing logged yet.