Mobile resilience

Your CSS doesn't know about the notch, the home bar, or the keyboard

Safe areas

For full-bleed backgrounds, use viewport-fit=cover and apply safe-area padding to the content layer:

max(1rem, env(...)) ensures minimum padding even on devices without insets.

Fixed elements at the bottom need explicit inset handling:

Without this, the home indicator covers your UI.

Never disable zoom

No maximum-scale. No user-scalable=no. If your layout breaks under zoom, the layout is the bug.

Test under zoom

  1. Pinch to 200-300% on a phone.
  2. Tap form fields, buttons, and links.
  3. Overlapping elements, hidden content, or frozen scrolling are bugs.

On desktop: Cmd+= to zoom. Anything that clips or overflows is a layout failure.

100dvh, not 100vh

100vh includes browser chrome on mobile. 100dvh adjusts as browser chrome shows and hides:

Use min-height, not height. Content that exceeds the viewport should scroll, not clip.

text-size-adjust

Mobile Safari auto-scales text in narrow columns:

Common mistakes