CSS Grid Layout Example — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the CSS Grid Layout Example 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
Build a three-column strip
easy10 minThree 100px columns with a 12px gap.
- 2
Build a two-column layout
easy10 minA 200px sidebar and a 300px main column.
- 3
Centre content in every cell
easy10 minThree 100px columns with items centred.
- 4
Add padding around the grid
easy10 minThree columns with 24px padding on the container.
- 5
Compose the full layout
medium10 minColumns, gap, padding and centred items together.
Find the bug(5)
- 1
Fix the missing container
easy8 minThe tracks are declared but the element is not a grid.
- 2
Fix place-items misspelled
easy8 minThe shorthand is place-items.
- 3
Fix the swapped track sizes
easy8 minThe sidebar should be the narrow column.
- 4
Fix padding applied to the cells
easy8 minThe spacing belongs on the container.
- 5
Fix the wrong repeat count
easy8 minThere should be three columns, not two.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace