Skip to content
Miraat·dweb developer journey, reflected

Responsive Design

Building pages that adapt from phone to desktop without separate versions.

Foundation 25 minutes Prerequisites: Layout: Flexbox and Grid

Key ideas

  1. Mobile-first: write CSS for narrow screens first, then add media queries for wider ones.
  2. Relative units: rem, %, vw/vh instead of fixed pixels.
  3. Fluid images: max-width: 100%; height: auto.
  4. Breakpoints: a few (e.g. 640, 1024, 1280) chosen by content, not by device.
.card { padding: 12px; }
@media (min-width: 640px) {
  .card { padding: 24px; }
}

Recommended resources