CSS Position — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the CSS Position 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
Shift with relative
easy10 minMove #box 10px down without leaving the flow.
- 2
Position absolutely
easy10 minPin #box to the top-left of its positioned parent.
- 3
Pin to the viewport
easy10 minMake #box fixed.
- 4
Stick on scroll
easy10 minMake #box sticky with a top offset.
- 5
Use the inset shorthand
medium10 minAbsolutely position #box 12px from every edge.
Find the bug(5)
- 1
Fix the sticky with no offset
easy8 minSticky does nothing without a top offset.
- 2
Fix the missing positioning context
easy8 minThe absolute box escapes to the page without a positioned parent.
- 3
Fix fixed used instead of sticky
easy8 minThis should stay in flow until it reaches the top.
- 4
Fix the offset without a position
easy8 minOffsets do nothing on a static element.
- 5
Fix the misspelled value
easy8 minThe value is absolute.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace