I achieve grid wrapping by using auto-fit. Now I have a special div where it takes two column. Now when ever the grid is suppose to wrap to one column, the even div's disappears
Now you can see it here when viewport is below 670px the pink box disappears.
How can I solve this problem?
.grid {
gap: 20px;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.box,
.special-box {
height: 200px;
}
.box:nth-child(even) {
background-color: pink;
}
.box:nth-child(odd) {
background-color: orange;
}
.special-box {
background-color: purple;
grid-column: span 2;
}
<div class="grid">
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="special-box"></div>
</div>