HTML & CSS · Junior · Question 33 of 75

How do you make a grid item span the full width of the grid regardless of the number of columns?

Explanation

Negative line numbers count from the end; -1 is the last line of the explicit grid, so 1 / -1 spans from the first line to the last. width: 100% only fills the item's own cell. CSS Grid has no span all syntax.

Further reading

Problem with a question

HTML & CSS · Junior · question 33

Test yourself

Take the HTML & CSS · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz