.cards { display: grid; grid-template-columns: 1fr; } @media (min-width: 768px) { .cards { grid-template-columns: 1fr 1fr; } }A phone receives one column, while tablet and desktop receive two.
LESSON 72 OF 100
Start with one column and expand the layout only when space is available.
In a mobile-first approach, the base rule serves the small screen. A min-width media query adds the more complex layout from the chosen threshold upward.
.cards { display: grid; grid-template-columns: 1fr; } @media (min-width: 768px) { .cards { grid-template-columns: 1fr 1fr; } }A phone receives one column, while tablet and desktop receive two.
.cards { grid-template-columns: 1fr 1fr; } @media (min-width: 768px) { .cards { grid-template-columns: 1fr; } }This order starts with the wide version and narrows it on large screens, so it is not mobile-first.
Keep one column in the CSS base and define two columns from 768px.
The simple base reduces mobile overrides, while the enhancement is progressively enabled through min-width.
ANALYSIS REQUEST
The initial discussion is without obligation. You receive an honest recommendation, suitable stages and the factors that affect price.