Responsive grid without media queries

Css

auto-fill with minmax reflows on its own, so the column count follows the container rather than a breakpoint list.

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

More in Web & CSS

Random picks