I'm having trouble creating a grid layout with flexbox. The issue arises when the last row of items doesn't align left because I'm using justify-content: space-between. Here's a link to my JS Fiddle for reference: https://jsfiddle.net/b5f4jmhu/
When there aren't enough boxes to fill a complete row, the boxes in the last row get spaced out evenly. Does anyone have any suggestions on how I can make the last row align to the left instead?
.boxes {
max-width: 600px;
background: #ccc;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
padding: 20px 20px 0 20px;
margin: 60px auto 60px auto;
}
.box {
flex: 0 0 22%;
height: 100px;
background: #222;
margin: 0 0 20px 0;
}
<div class="boxes">
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
</div>
Thank you, Jamie