The place-content property is a shorthand for align-content and justify-content. It aligns and distributes content inside grid and flex containers.
01
Shorthand
Two in one.
02
Grid
Track alignment.
03
Flexbox
Wrapped lines.
04
center
Common value.
05
space-*
Distribute gaps.
06
Two Values
Block + inline.
Fundamentals
Introduction
The place-content property in CSS is a shorthand property used to align and distribute content within a container. It combines the functionality of align-content and justify-content properties into one.
This property is particularly useful for controlling the alignment of items along both the block and inline axes in a grid or flex container.
Definition and Usage
Use place-content when you want to position the whole group of tracks or flex lines inside a container that has extra space. It does not replace place-items, which aligns items inside their own cells.
A single value such as center applies to both axes. Two values let you set block-axis and inline-axis alignment separately.
💡
Beginner Tip
Need one box in the middle of a grid area? place-content: center on the container is often the quickest solution.
Foundation
📝 Syntax
The place-content property can accept one or two values. When two values are provided, the first value applies to the block axis (vertical alignment in horizontal writing modes), and the second value applies to the inline axis (horizontal alignment).
align-content — Specifies the alignment of the content along the block axis.
justify-content — Specifies the alignment of the content along the inline axis.
Basic Example
place-content.css
.container{display:grid;place-content:center;}
Syntax Rules
One value sets both align-content and justify-content.
Two values set block axis first, then inline axis.
Works on grid containers and flex containers with wrapped content.
Most useful when the container is larger than its content tracks or lines.
Do not confuse with place-items, which targets item alignment inside cells.
Distribution keywords like space-between need extra free space to show an effect.
Defaults
🎯 Default Value
The initial value of place-content follows its longhand properties: align-content: normal and justify-content: normal. If you provide only one value, it is used for both axes.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Shorthand for
align-content + justify-content
Applies to
Grid and flex containers
Inherited
No
Animatable
No
Common use
Center or distribute content tracks in a container
Reference
💎 Property Values
place-content accepts the same values as align-content and justify-content.
Value
Example
Description
start
place-content: start;
Aligns the content to the start of the container along the respective axis.
end
place-content: end;
Aligns the content to the end of the container along the respective axis.
center
place-content: center;
Centers the content along the respective axis.
space-between
place-content: space-between;
Distributes the content evenly with space between the items along the respective axis.
space-around
place-content: space-around;
Distributes the content evenly with space around the items along the respective axis.
space-evenly
place-content: space-evenly;
Distributes the content evenly with equal space around and between the items along the respective axis.
stretch
place-content: stretch;
Stretches the content to fill the container along the respective axis where supported.
centerspace-betweenspace-evenlystartend
Context
When Does place-content Matter?
place-content shines when a container has unused space around its tracks or wrapped lines:
Centered layouts — Put a small grid or flex group in the middle of a large area.
Dashboard shells — Distribute rows or columns with space-between.
Card grids — Spread tracks evenly with space-evenly.
Shorter syntax — Replace two longhand properties with one declaration.
If you only need to align one item inside its cell, use place-items instead.
Preview
👀 Live Preview
Compare place-content: start with place-content: center on the same two-item grid.
start
1
2
center
1
2
Hands-On
Examples Gallery
Start with centered grid content, try mixed axis values, use flexbox, and distribute tracks with space-evenly.
▦ Grid Alignment
Use place-content on grid containers — matching the reference examples.
Example 1 — Centered Grid Content
In this example, we align the content of a grid container to the center both vertically and horizontally.
A grid or flex container is larger than its tracks or wrapped lines.
Free space
2
You set place-content
One or two keywords decide alignment and distribution on each axis.
CSS rule
3
Tracks move as a group
The browser positions or spreads the content tracks inside the container.
Layout engine
=
▦
Aligned layout group
Content sits centered, pushed to an edge, or distributed with even spacing.
Compatibility
Browser Compatibility
The place-content property is well-supported in modern browsers. However, always check the latest compatibility tables to ensure that it works as expected across different browsers and their versions.
✓ Grid & Flex · Modern support
Reliable place-content support
Chrome, Firefox, Safari, Edge, and Opera support place-content for grid and flex layouts.
96%Modern browser support
Google Chrome59+ · Desktop & Mobile
Full support
Mozilla Firefox45+ · Desktop & Mobile
Full support
Apple Safari11+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Opera46+ · Modern versions
Full support
Testing tip
Verify both grid and flex use cases in your target browsers, especially when mixing space-* values with fixed track sizes.
place-content property96% supported
Bottom line:place-content is widely available in modern browsers for grid and flexbox layouts.
Wrap Up
Conclusion
The place-content property is a versatile tool for aligning and distributing content within a container.
By combining the capabilities of align-content and justify-content, it allows for easy and precise control over the layout of grid and flex items. Experiment with different values to achieve the desired alignment and distribution in your web projects.
Use place-content: center for quick whole-group centering
Prefer shorthand when both axes use related alignment
Give the container explicit height or width so free space exists
Use two values when block and inline axes need different behavior
Pair with grid or wrapping flex for best results
❌ Don’t
Confuse place-content with place-items
Expect distribution keywords to work without extra free space
Use place-content when you only need one item centered in a cell
Forget that flex needs wrapping for multi-line content alignment
Overuse space-between when only one track exists
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about place-content
Use these points when aligning content tracks in grid and flex layouts.
5
Core concepts
▦01
Shorthand
align + justify content.
Purpose
⚙02
normal Default
Longhand initial.
Default
◉03
center
Both axes.
Pattern
↔04
Two Values
Block then inline.
Syntax
pi05
place-items
Different shorthand.
Related
❓ Frequently Asked Questions
place-content is a shorthand that sets align-content and justify-content together. It controls how content is aligned and distributed along the block and inline axes in a grid or flex container.
place-content aligns the overall content tracks within the container. place-items aligns individual items inside their cells. They solve different layout problems.
Yes. place-content works on flex containers with wrapped lines and on grid containers. It is most useful when extra space exists along an axis.
A single value applies to both align-content and justify-content. For example, place-content: center centers content on both axes.
The initial value follows align-content and justify-content, which is normal for both axes unless you set something else.