CSS Grid Gap — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the CSS Grid Gap 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
Add a uniform gap
easy10 minGive the grid a 16px gap on both axes.
- 2
Different row and column gaps
easy10 minSet a 10px row gap and a 30px column gap with the shorthand.
- 3
Set only the row gap
easy10 minGive the grid a 22px row gap.
- 4
Set only the column gap
easy10 minGive the grid an 18px column gap.
- 5
Use rem for the gap
medium10 minGive the grid a 2rem gap (32px).
Find the bug(5)
- 1
Fix the deprecated grid-gap
easy8 minThe modern property is simply gap.
- 2
Fix the reversed shorthand
easy8 mingap takes the row value first, then the column value.
- 3
Fix margins used instead of gap
easy8 minGrid children are spaced with gap.
- 4
Fix the missing unit
easy8 minA bare number is not a valid gap.
- 5
Fix the wrong axis
easy8 minThe gap was applied to rows instead of columns.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace