Use css subgrid with automatic column spans
I have the following html structure. <div class="grandparent"> <div class="parent"> <div class="achild2">Child 2</div> <div class="achild2">Child 2</div> <div class="achild2">Child 2</div> <div class="achild2">Child 2</div> <div class="achild2">Child 2</div> <div class="achild2">Child 2</div> </div> <div class="achild1">Child 1</div> </div> .parent { display: grid; grid-template-columns: subgrid; grid-column:…