.layout { display: grid; grid-template-columns: 1fr 1fr; } @media (max-width: 720px) { .layout { grid-template-columns: 1fr; } }Desktop uses two columns, while a phone stacks them without changing the HTML.
LESSON 71 OF 100
Turn two columns into one when space becomes narrow.
A media query applies rules only when its condition is true. The base rule keeps two columns, while max-width: 720px replaces them with one on screens up to 720px wide.
.layout { display: grid; grid-template-columns: 1fr 1fr; } @media (max-width: 720px) { .layout { grid-template-columns: 1fr; } }Desktop uses two columns, while a phone stacks them without changing the HTML.
@media (min-width: 720px) { .layout { grid-template-columns: 1fr; } }min-width would apply one column from 720px upward, the opposite of the requirement.
Keep the two-column base grid and complete the media query with one column at a maximum width of 720px.
The rule inside @media overrides only the column count when the width condition is met.
ANALYSIS REQUEST
The initial discussion is without obligation. You receive an honest recommendation, suitable stages and the factors that affect price.