The place-content CSS shorthand property sets both the align-content and justify-content properties.
/* Positional alignment */ place-content: center start; place-content: start center; place-content: end left; place-content: flex-start center; place-content: flex-end center; place-content: left center; place-content: right end; /* Baseline alignment */ place-content: baseline baseline; place-content: first baseline last baseline; place-content: last baseline baseline; /* Distributed alignment */ place-content: space-between space-evenly; place-content: space-around space-evenly; place-content: space-evenly stretch; place-content: stretch space-evenly; /* Global values */ place-content: inherit; place-content: initial; place-content: unset;
Value not found in DB!
The first value is the align-content property value, the second the justify-content one. If the second value is not present, the first value is also used for it.
startendflex-startstart.flex-endend.centerleftstart.rightstart.space-betweenbaseline
first baselinelast baseline
first baseline is start, the one for last baseline is end.space-aroundspace-evenlystretchauto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container#container {
display: flex;
height:240px;
width: 240px;
flex-wrap: wrap;
background-color: #8c8c8c;
writing-mode: horizontal-tb; /* Can be changed in the live sample */
direction: ltr; /* Can be changed in the live sample */
place-content: flex-end center; /* Can be changed in the live sample */
}
div > div {
border: 2px solid #8c8c8c;
width: 50px;
background-color: #a0c8ff;
}
.small {
font-size: 12px;
height: 40px;
}
.large {
font-size: 14px;
height: 50px;
}
<div id="container"> <div class="small">Lorem</div> <div class="small">Lorem<br/>ipsum</div> <div class="large">Lorem</div> <div class="large">Lorem<br/>impsum</div> <div class="large"></div> <div class="large"></div> </div>
| Specification | Status | Comment |
|---|---|---|
| CSS Box Alignment Module Level 3 The definition of 'place content' in that specification. | Working Draft | Initial definition |
| Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|---|
| Basic support | 59 | ? | Yes | ? | ? | ? |
| Feature | Android webview | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
|---|---|---|---|---|---|---|---|
| Basic support | 59 | 59 | ? | Yes | ? | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/place-content