CSS place-items Property Explained
What the CSS place-items property does, with an example.
Published November 7, 2026
place-items is a grid/flex shorthand for align-items and justify-items. place-items: center centres items both ways in a grid.
How it works
One value sets both; two values set align-items then justify-items. It is the shortest way to centre content in a grid cell.
In flexbox, justify-items is ignored, so use justify-content instead.
Values and effects
place-items: center; → centre both ways
place-items: start; → top-left
place-items: end; → bottom-right
place-items: stretch; → fill (default)
Practical examples
Centre content
.hero { display: grid; place-items: center; min-height: 100vh; }Align cell contents
.grid { display: grid; grid-template-columns: repeat(3, 1fr); place-items: center start; }Single item override
.cell { place-self: end center; }Common mistakes
- Expecting justify-items to work in flexbox.
- Forgetting display: grid.
- Container without a height for vertical centring.
Key takeaways
- place-items in one line: place-items is a grid/flex shorthand for align-items and justify-items.
- Inspect it live in DevTools → Styles.
- Test across browsers and screen sizes.
FAQ
place-items vs place-content?
place-items aligns items inside cells; place-content aligns the whole grid inside the container.
Is place-items supported in all browsers?
Yes in all modern browsers; check caniuse.com for edge cases.