CKTIS / CSS
CSS property `place-content`
`place-content` is a shorthand for distributing the whole set of tracks or lines: its first value sets `align-content` on the cross/block axis, and its optional second value sets `justify-content` on the main/inline axis.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
<'align-content'> <'justify-content'>?place-content is a shorthand for distributing the whole set of tracks or lines: its first value sets align-content on the cross/block axis, and its optional second value sets justify-content on the main/inline axis.
The example measures a single track inside a box: end start moves it to the block-axis end and inline-axis start, while one center expands to centering on both axes.
Grammar: <'align-content'> <'justify-content'>?.
When the second value is omitted, the first is copied except for a baseline position: baseline makes the second component start. The shorthand distributes grid tracks, lines of a multi-line flexbox, or a multicol column set, and it can align the contents of a block container. On a block container only align-content is effective; justify-content has no effect. It does not align individual items, and without free space its distribution may be invisible.
Examples
<!doctype html><meta charset="utf-8"><style>html,body{margin:0}.grid{position:absolute;top:0;width:200px;height:120px;display:grid;grid-template-columns:40px;grid-template-rows:20px}.grid i{width:40px;height:20px}</style><div id="two" class="grid" style="left:0;place-content:end start"><i></i></div><div id="one" class="grid" style="left:300px;place-content:center"><i></i></div><div id="baseline" class="grid" style="left:600px;place-content:baseline"><i></i></div><pre id="result"></pre><script>const offset=box=>{const a=box.getBoundingClientRect(),b=box.firstElementChild.getBoundingClientRect();return [Math.round(b.left-a.left),Math.round(b.top-a.top)]},a=offset(two),b=offset(one),twoStyle=getComputedStyle(two),oneStyle=getComputedStyle(one),baseStyle=getComputedStyle(baseline);if(a.join(',')!=='0,100'||b.join(',')!=='80,50'||twoStyle.alignContent!=='end'||twoStyle.justifyContent!=='start'||oneStyle.alignContent!=='center'||oneStyle.justifyContent!=='center'||baseStyle.alignContent!=='baseline'||baseStyle.justifyContent!=='start')throw new Error('place-content alignment mismatch');result.textContent='two='+a.join(',')+' '+twoStyle.alignContent+'/'+twoStyle.justifyContent+'; one='+b.join(',')+' '+oneStyle.alignContent+'/'+oneStyle.justifyContent+'; baseline='+baseStyle.alignContent+'/'+baseStyle.justifyContent;</script>Result
two=0,100 end/start; one=80,50 center/center; baseline=baseline/start
The example measures a single track inside a box: `end start` moves it to the block-axis end and inline-axis start, while one `center` expands to centering on both axes.