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?
- ✓Correct answer:
grid-column: 1 / -1 - 2
width: 100% - 3
grid-column: span all
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.