CSS Transform — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the CSS 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
Rotate an element
easy10 minRotate #box by 45 degrees using the rotate property.
- 2
Scale an element
easy10 minScale #box to 1.5 times its size.
- 3
Move an element
easy10 minTranslate #box 10px right and 20px down.
- 4
Change the origin
easy10 minSet the transform origin of #box to its top-left corner.
- 5
Combine transforms
medium10 minRotate #box 30 degrees and scale it to 2.
Find the bug(5)
- 1
Fix the angle with no unit
easy8 minAn angle needs a unit such as deg.
- 2
Fix the scale given a length
easy8 minscale takes a plain number, not a length.
- 3
Fix the swapped translation
easy8 minThe horizontal value comes first.
- 4
Fix the misspelled property
easy8 minThe property is transform-origin.
- 5
Fix the transform on the wrong element
easy8 minThe inner box should rotate, not the wrapper.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace