.container {
display: inline-flex;
display: inline flex;
}Supporting older browsers / notebook
Supporting older browsers
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
:is(:-prefix-mistake, :unsupported-pseudo),
.valid {
font-family: sans-serif;
}
:-prefix-mistake,
:unsupported-pseudo,
.valid {
color: red;
}* {
box-sizing: border-box;
}
.wrapper {
background-color: palegoldenrod;
padding: 10px;
max-width: 400px;
display: grid;
grid-template-columns: repeat(3, 1fr);
}
.item {
border-radius: 5px;
background-color: rgb(207 232 220);
}
@supports (grid-template-rows: subgrid) {
.wrapper {
grid-template-rows: subgrid;
gap: 10px;
background-color: lightblue;
text-align: center;
}
}<div class="wrapper">
<div class="item">Item One</div>
<div class="item">Item Two</div>
<div class="item">Item Three</div>
<div class="item">Item Four</div>
<div class="item">Item Five</div>
<div class="item">Item Six</div>
</div>