Is there a way to create a grid layout with divs that leave space on the left side of each subsequent row? For example, having 4 div boxes in the first row, 3 in the second, 2 in the third, and so on.
Demo
https://i.sstatic.net/Gli6L.png
Styling in 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;
}
Code Snippet in 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>