CSS 2D Transform — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the CSS 2D Transform 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
Scale with a function
easy10 minUse transform to scale #box to twice its size.
- 2
Translate horizontally
easy10 minMove #box 20px to the right with transform.
- 3
Translate on both axes
easy10 minMove #box 10px right and 20px down with transform.
- 4
Scale each axis
easy10 minScale #box 2x horizontally and 3x vertically.
- 5
Chain two functions
medium10 minMove #box 10px right, then scale it to 2.
Find the bug(5)
- 1
Fix scale given a length
easy8 minscale() takes a unitless number.
- 2
Fix the wrong axis
easy8 minThe box should move horizontally.
- 3
Fix the missing units
easy8 mintranslate() needs lengths, not bare numbers.
- 4
Fix the swapped arguments
easy8 mintranslate() takes x first, then y.
- 5
Fix the comma between functions
easy8 minChained transform functions are separated by spaces.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace