place-content

A shorthand property that sets align-content and justify-content at once. Controls the alignment of the entire content within a grid container.

Class List

ClassCSSDescription
pcsplace-content: startAlign content to the start position
pccplace-content: centerCenter content horizontally and vertically
pceplace-content: endAlign content to the end position
pcstplace-content: stretchStretch content to fill the entire container
pcsbplace-content: space-betweenPlace first/last items at edges, distribute rest evenly
pcsaplace-content: space-aroundEqual margin around each track
pcseplace-content: space-evenlyDistribute all gaps completely evenly

Visual Comparison

Compares alignment differences based on place-content values with a fixed-height grid container.

start — pcs

ABCD

center — pcc

ABCD

end — pce

ABCD

space-between — pcsb

ABCD

space-evenly — pcse

ABCD

Usage Examples

<!-- Grid content center aligned -->
<div class="dg gtcr2-1fr pcc h100vh">
  <div>Center aligned content</div>
  <div>Center aligned content</div>
</div>

<!-- Separate top/bottom with space-between -->
<div class="dg pcsb h100vh">
  <header>Header (top)</header>
  <footer>Footer (bottom)</footer>
</div>

Tips & Notes

Perfect centering with pcc

dg pcc is the most concise way to center grid content both horizontally and vertically.

place-content vs place-items

place-content aligns the entire grid tracks, while place-items aligns items within each cell. The difference appears when the container has extra space.