I have a grid layout of 8 divs. I am trying to increase the height of the 5th div and decrease the height of the 8th div. Every way I have tried I get a big gap. I haven't used masonry isotope before and need to reorder the divs for mobile so thought to use flexbox. I would really appreciate some help and pointing to some good tutorials when needing to use different heights in a grid layout. Is flexbox the best way to do this
.container {
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: start;
align-items: baseline;
align-content: start;
width: 1058px;
}
.item {
flex: 1 1 auto;
margin: 3px;
border: 1px solid red;
}
<body>
<div class="container">
<div class="item">
<img src="https://via.placeholder.com/635x300.png">
</div>
<div class="item">
<img src="https://via.placeholder.com/267x300.png">
</div>
<div class="item">
<img src="https://via.placeholder.com/267x300.png">
</div>
<div class="item">
<img src="https://via.placeholder.com/267x300.png">
</div>
<div class="item">
<img src="https://via.placeholder.com/267x300.png">
</div>
<div class="item">
<img src="https://via.placeholder.com/267x300.png">
</div>
<div class="item">
<img src="https://via.placeholder.com/267x300.png">
</div>
<div class="item">
<img src="https://via.placeholder.com/267x300.png">
</div>
</div>
</body>
?