HTML Images — exercises and bug fixes
6 hands-on exercises and 5 find-the-bug challenges for the HTML Images lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Exercises(6)
- 1
Create an accessible image figure
easy15 minImprove the image by adding the exact alternative text “HTML and CSS workspace”. Then place it inside a figure and add a figcaption.
- Place the image inside a figure
- Add the requested alternative text
- Add a figcaption inside the figure
- 2
Add an image
easy10 minAdd an img pointing at /logo.png.
- 3
Describe the image
easy10 minGive the image meaningful alt text.
- 4
Mark a decorative image
easy10 minUse an empty alt for a purely decorative image.
- 5
Reserve the space
easy10 minAdd width and height so the layout does not shift.
- 6
Lazy-load an image
medium10 minDefer loading of a below-the-fold image.
Find the bug(5)
- 1
Fix the missing alt
easy8 minScreen readers announce the filename without alt text.
- 2
Fix the wrong source attribute
easy8 minImages use src, not href.
- 3
Fix the redundant alt text
easy8 minAlt text should not start with "image of".
- 4
Fix the div with a background image
easy8 minContent images belong in an img element.
- 5
Fix the eager offscreen image
easy8 minA below-the-fold image should lazy-load.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace