On this page
  1. Display & Layout
  2. Contents
  3. Outer & Inner display Modes
  4. Flexbox Properties (1D Layout)
  5. Grid Properties (2D Layout)

Display & Layout

Prev: Box Model & Sizing | Up: properties | Next: Positioning & Stacking
Rel: Modern Layout: Flexbox & Grid, Math & Sizing Functions
Ref: MDN Web Docs — display
Tags: #public #web #css #properties #layout


Contents


Outer & Inner display Modes

Every display value controls how an element participates in its parent flow (block, inline) and how its own children are laid out (flow-root, flex, grid, none, contents).


Flexbox Properties (1D Layout)

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between; /* main axis */
  align-items: center;            /* cross axis */
  gap: 0.75rem;
}
.toolbar .grow {
  flex: 1 1 12rem; /* flex-grow flex-shrink flex-basis */
}

Grid Properties (2D Layout)

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
  align-items: start;
}

Linked from

Related notes