The desired layout for wide screens:
The desired layout for narrow screens:
Initial CSS:
.La
Use grid-column: 1/-1;
.box {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
grid-gap: 24px 40px;
}
span {
height: 50px;
background: blue;
}
.more {
grid-column: 1/-1;
background: red;
}
That you can edit like below if you want to always have a maximum of 2 columns:
.box {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(max(240px,40vw), 1fr));
grid-gap: 24px 40px;
}
span {
height: 50px;
background: blue;
}
.more {
grid-column: 1/-1;
background: red;
}