moves / css / grid essentials

Grid essentials

Grid is two-dimensional. `repeat(auto-fit, minmax(...))` gives a responsive card layout without a single media query.

#grid#responsive#layout
css

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

.sidebar-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
}

.span-two { grid-column: span 2; }

Related

WWADD — Choose the tool. Make the move. Build the stack.

FREE REFERENCE · NO LOGINCONTACTPRIVACYTERMS