Clipping & Masking — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the Clipping & Masking lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Exercises(5)
- 1
Clip to a circle
easy10 minClip #box to a circle covering half its width.
- 2
Clip with inset
easy10 minClip 10px off the top and bottom, 20px off the sides.
- 3
Clip to a triangle
easy10 minClip #box to a triangle using three polygon points.
- 4
Clip to an ellipse
easy10 minClip #box to a 40% by 30% ellipse centred in the box.
- 5
Fade with a mask
medium10 minMask #box with a gradient from black to transparent.
Find the bug(5)
- 1
Fix the legacy property
easy8 minThe modern property is clip-path.
- 2
Fix the missing unit
easy8 mininset() values need units.
- 3
Fix the missing commas
easy8 minPolygon points are separated by commas.
- 4
Fix the missing position keyword
easy8 minAn ellipse position is introduced with "at".
- 5
Fix shape-outside used to mask
easy8 minFading an element out uses mask-image.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace