Design layouts for every device: 24 levels of media queries, clamp and container queries. A responsive design game for understanding modern breakpoints.
Viewport units are sizes relative to the browser's screen size. vw (viewport width) means a percentage of the screen width. For example, 50vw = half the screen width, no matter how wide the screen is.
A media query (@media) lets you apply different CSS based on the viewport condition. max-width means "if the screen width is less than or equal to this value". This is the main way to make a website responsive.
Responsive typography means setting different text sizes at each screen size. Text that's comfortable to read on desktop can be too big on a phone. Use several tiered media queries (mobile-first) to set the size gradually.
A responsive layout changes the arrangement of elements based on the screen size. A common pattern: 1 column on a phone (easy to scroll), 2 columns on a tablet, and 3+ columns on a desktop. Use grid-template-columns inside a media query.
An image with a fixed size (px) can overflow its container on a small screen. The basic responsive image technique: max-width: 100% so it doesn't overflow, and height: auto so the aspect ratio is preserved.
Time to build a complete page layout. A common pattern: mobile-first (column/stacked) then change to a side-by-side layout (row) on a large screen. The header and footer stay full-width, the sidebar + main change their arrangement.
And more, 24 levels in all.