I am creating custom Grid and I want to show 4 Columns if Screen size is big and 2 columns if the minimum screen size is 50px and maximum screen size is 400px. I wrote the media query but it's not working. Following is my code:
.CustomGridHeader {
width: 100%;
}
.Grid {
width: 50%;
float: left;
}
.item {
width: 50%;
float: left;
border: 1px solid;
}
@media (min-width: 50px) and (max-width: 300px) {
.Grid {
width: 100%;
float: none;
}
}
<div class="CustomGridHeader">
<div class="Grid">
<div class="item">
Item 1
</div>
<div class="item">
Item 2
</div>
</div>
<div class="Grid">
<div class="item">
Item 3
</div>
<div class="item">
Item 4
</div>
</div>
</div>
What am I doing wrong?
flexboxandgrid, please make use of that.