I'm experiencing an issue with these 5 buttons in mobile view. On desktop, all 5 buttons are displayed inline. However, on mobile, the last 2 buttons should appear below the first 3. I need them to remain fixed and occupy all available space even when the view is resized to smaller sizes. Please refer to the attached image for reference. Thank you.
https://i.sstatic.net/3fbAS.png
HTML
<div class="cont6">
<button type="button" onclick="location.href='#date_2019'">2019 AAA</button>
<button type="button" onclick="location.href='#date_2018'">2018 AAA</button>
<button type="button" onclick="location.href='#date_2017'">2017 AAA</button>
<button type="button" onclick="location.href='#date_2016'">2016 AAA</button>
<button type="button" onclick="location.href='#date_2015'">2015 AAA</button>
</div>
CSS
.cont6 { margin:0 2%; display:flex; justify-content:space-between; width:96%; }
.cont6 button {
background-color:#EEE;
border:1px solid #E5E5E5;
color:#BF0000;
font-weight:bold;
font-size:17px;
padding:1% 1% 1% 3%;
cursor:pointer;
}
.cont6 button:after { content:'\2BC6'; margin-left:40px; }
@media only screen and (max-width:640px){
.cont6 { width:auto; display:block; }
.cont6 button { margin-bottom:15px; margin-right:2%; font-size:16px; }
}