Responsive Card Grid Without Media Queries
cssHTML, CSS and Webtipsintermediate
Cards that fill the row and wrap automatically, each at least 240px wide.
.cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 1rem;
}
.cards > * {
padding: 1rem;
border: 1px solid #e2e8f0;
border-radius: 0.5rem;
}