I am perplexed as to why this is not functioning correctly.
#parent {
display: flex !important;
flex-flow: row wrap;
width: 100% !important;
justify-content: flex-start;
}
.item{
flex: 1 !important;
flex-basis: calc(100% / 4);
box-sizing: border-box ;
border: solid 1px #000000;
margin-bottom: 30px !important;
max-width: 24%;
height: 50px;
}
@media screen and (max-width: 767px) {
/* start of medium tablet styles */
.item{
flex-basis: calc(100% / 3) !important;
}
}
@media screen and (max-width: 479px) {
/* start of phone styles */
.item{
flex-basis: calc(100% / 2) !important;
}
}
<div id="parent">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
My intention was to adjust the flex-basis
of the flex items on smaller screens, with 4 items per row normally, changing to 3 on tablets and 2 on mobile devices.