HTML & CSS · Middle · Question 9 of 75
What does place-items: center do on a grid container?
- 1Centers the grid container itself inside its parent on both axes
- 2Moves the whole set of grid tracks to the container's center, like
place-content - ✓Correct answer: Shorthand for
align-items+justify-items: centers items within their cells
Explanation
place-items = align-items + justify-items, i.e. aligning each item within its own cell. Aligning the whole grid (tracks) within the container is place-content (align-content + justify-content). The container itself is centered by its parent's styles.