Responsive Design
Responsive CSS helps a page adapt to phones, tablets, and larger screens.
Change layout for smaller screens
A media query applies styles only when a condition is true, such as when the browser window is narrower than a chosen width.
.cards {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1rem;
}
@media (max-width: 600px) {
.cards {
grid-template-columns: 1fr;
}
}
Test your page at different widths and make sure text and controls remain easy to use.