Skip to content

Day 1: Mobile-First & Flexible Media

Adopt the mobile-first development philosophy and build fluid, flexible images and media.

Design for mobile screens first (simplest layout), then layer on complexity for larger screens using min-width media queries.

Images must never overflow their parent container:

img {
max-width: 100%;
height: auto;
display: block;
}
.avatar {
width: 120px;
height: 120px;
object-fit: cover; /* Prevents distortion while cropping neatly */
border-radius: 50%;
}
  1. Add a global responsive image reset to your stylesheet.
  2. Build an avatar component using object-fit: cover.