Place Content Shorthand Property

Last updated: 2026-09-13

place-content Place Content Shorthand Property

place-content is a shorthand for align-content and justify-content. On a grid container it controls how the entire grid content area aligns relative to the container. When the total size of the grid tracks is smaller than the container, this property decides how the leftover space is distributed. It is key for centering and distributing the whole grid.

Category
Initial Valuenormal
InheritedNo
Applies To
Animation Type
CSS VersionCSS3
StatusStandard

📝 Syntax

place-content: <align-content> <justify-content>?;

⚙️ Values

ValueTypeDescription
<align-content> / <justify-content>ValueContent alignment shorthand

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
place-content v57 v16 v52 v10.1 v44
Supported in all major browsers
Tip: place-content: center centers the whole grid both horizontally and vertically in the container.
Tip: Values such as space-between, space-around and space-evenly control how the space is distributed between the grid tracks.

❓ FAQ

QWhen does place-content actually take effect?
AOnly when the total size of the grid tracks (including gap) is smaller than the container. The browser then aligns and distributes the leftover space according to the place-content value. If the tracks fill the container by adapting with fr units, or if the container is sized by its content with no spare room, the property shows no visible effect. To make it work, size the tracks with fixed or minmax values and give the container a definite width and height.
QShould I use place-content or place-items?
AThey act at different levels and are often used together. place-content positions the whole grid content area inside the container, answering “the grid is smaller than the container, how do I lay it out”. place-items aligns each grid item inside its own cell, answering “how do I arrange the items within each cell”. Center the group with place-content; center the items with place-items.
QWhy does place-content: center sometimes do nothing in a grid?
AThe most common reason is that the grid fills the container: tracks sized with fr absorb all the remaining space automatically, so there is no spare area for place-content to act on. Another reason is that the container height comes from its content, leaving no leftover space. To center the whole grid with place-content: center, size the tracks with fixed or minmax values and give the container explicit dimensions.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏