CSS 3 · Grid
Make a responsive grid without media queries
Fit as many columns of at least 250px as the width allows.
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1rem;
}
CSS 3 · Grid
Fit as many columns of at least 250px as the width allows.
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1rem;
}
Was this page helpful?