Here's a similar situation
.items {
width: 100%;
display: flex;
align-items: center;
justify-content: flex-start;
flex-wrap: wrap;
background: #cecece;
padding: 10px;
margin: 20px;
}
.item {
height: 100%;
flex: 0 0 calc(50% - 8px);
margin: 4px;
background: #16B6B6FF;
}
<div class="items">
<div class="item" style="order: 1">1</div>
<div class="item" style="order: 3">2</div>
<div class="item" style="order: 5">3</div>
<div class="item" style="order: 2">4</div>
<div class="item" style="order: 4">5</div>
<div class="item" style="order: 6">6</div>
<div class="item" style="order: 99">7</div>
<div class="item" style="order: 98">8</div>
</div>
Is there an approach to rearrange 8
after 7
while maintaining the two-column layout without altering the HTML structure?
Desired result:
1 4
2 5
3 6
7
8