Responsive Design

Adapting to available space and user conditions: fluid layout, media and container queries, responsive images, CSS pixels versus device pixels, and typography that survives translation.

Fluid Layout First

Percentages, `min()`, `max()`, `clamp()` and the intrinsic behaviour of flex and grid express continuous adaptation; a breakpoint is what you reach for when the change genuinely cannot be continuous.

Q · How do I build a layout that fits every width, rather than the five widths I happened to test?
Media Queries Beyond Width

Width is one axis. Colour scheme, reduced motion, contrast, pointer precision, hover capability and orientation are separate questions — and the preference ones are accessibility features, not theming.

Q · What can I actually ask the browser about the user's conditions, and which of those answers am I obliged to respect?
Container Queries

A component should respond to the space it was given, not to the viewport it happens to be inside — which is why `container-type` establishes containment, and why that containment has real layout consequences.

Q · The same card is in a wide main column and a narrow sidebar. How does it know which one it is in?
Responsive Images

`srcset` and `sizes` for resolution switching, `<picture>` for art direction and format, `loading` and `decoding` for scheduling — and `width`/`height` or `aspect-ratio` always, so the browser can reserve the space.

Q · How do I send each user an image that is the right number of pixels, in a format their browser can decode, without the page jumping when it arrives?
The Viewport and Device Pixels

CSS pixels, device pixels and the ratio between them; the layout viewport versus the visual viewport; the one viewport meta tag worth writing — and why suppressing zoom is an accessibility failure, not a layout fix.

Q · When I write `16px`, what does that mean on a phone with a 3x screen, on a laptop at 150% OS scaling, and on a page a user has zoomed into?
Responsive Typography

Fluid type with `clamp()` that still honours the user's font size, a measure defined in characters rather than pixels, and layouts that survive a translation two-thirds longer than the English it was designed around.

Q · How do I make text scale with the space available without breaking zoom, readability, or the German build?