I have a section which contain six items.
I want 3 items per row on desktop, and on medium device I want 2 items per row, and 1 one Item per on mobile device
<div class="flex-container">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
</div>
Here is css:
.flex-container{
display: -webkit-box;
display: -ms-flexbox;
display: flex;
width: 100%;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
}
@media only screen and (max-width: 768px) and (min-width: 320px){
.flex-container {
display: flex;
justify-content: center;
flex-basis: 100%;
}
}
This shows me only 3 items on desktop and one per item in mobile, but no 2 items, what do I need to change in my code to get what I want?