Three 100px columns with a 12px gap.
Acceptance criteria
- 1.Three 100px columns with a 12px gap.
CSS Tutorial · CSS Grid
These 10 tasks go with the CSS Grid Layout Example chapter. 5 of them ask you to build something small from scratch; 5 give you code that is already broken and ask you to work out why. Set aside about 90 minutes for the whole set, though you can do them in any order.
Nothing here is marked by a person. When you press Submit, the editor checks your code against the points listed under each task and tells you straight away what passed and what didn't (you need a free account to submit). If you get stuck, there are hints, and a worked solution once you've had a go. The first 2 tasks are free; the rest are part of the practice plan.
If it's been a while since you read the chapter, here is how it starts: “A CSS Grid Layout combines rows, columns, and spacing to create structured and responsive web page layouts.” .
1.Build a three-column stripexercise · easy · 10 min
Three 100px columns with a 12px gap.
Passes when: Three 100px columns with a 12px gap.
2.Build a two-column layoutexercise · easy · 10 min · practice plan
A 200px sidebar and a 300px main column.
Passes when: A 200px sidebar and a 300px main column.
3.Centre content in every cellexercise · easy · 10 min · practice plan
Three 100px columns with items centred.
Passes when: Three 100px columns with items centred.
4.Add padding around the gridexercise · easy · 10 min · practice plan
Three columns with 24px padding on the container.
Passes when: Three columns with 24px padding on the container.
5.Compose the full layoutexercise · medium · 10 min · practice plan
Columns, gap, padding and centred items together.
Passes when: Columns, gap, padding and centred items together.
6.Fix the missing containerbug fix · easy · 8 min
The tracks are declared but the element is not a grid.
Passes when: The tracks are declared but the element is not a grid.
7.Fix place-items misspelledbug fix · easy · 8 min · practice plan
The shorthand is place-items.
Passes when: The shorthand is place-items.
8.Fix the swapped track sizesbug fix · easy · 8 min · practice plan
The sidebar should be the narrow column.
Passes when: The sidebar should be the narrow column.
9.Fix padding applied to the cellsbug fix · easy · 8 min · practice plan
The spacing belongs on the container.
Passes when: The spacing belongs on the container.
10.Fix the wrong repeat countbug fix · easy · 8 min · practice plan
There should be three columns, not two.
Passes when: There should be three columns, not two.
Between them these tasks cover Composing a grid, Tracks with gaps and Alignment.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.