I have a few divs and I want to leave the space of one div on the left side in every subsequent row of the grid. For instance, I want to have 4 div boxes in the first row, 3 div boxes in the second row, 2 boxes in the third row and so on.
Example
CSS
.wrapper {
display: grid;
grid-template-columns: repeat(4, 100px);
grid-gap: 1px;
grid-auto-flow: row;
grid-auto-rows: 100px 100px;
}
* {box-sizing: border-box;}
.wrapper > div {
border-radius: 5px;
background-color: #DCE0E7;
padding: 1em;
color: #d9480f;
}
HTML
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
<div>Six</div>
<div>Seven</div>
<div>Eight</div>
<div>nine</div>
<div>ten</div>
</div>
