Overview

Every responsive page needs <meta name="viewport" content="width=device-width, initial-scale=1">. Without it, mobile browsers lay the page out at a legacy width (about 980px) and zoom out. On mobile, the layout viewport and the visual viewport (the pinch-zoomed area) differ, and browser toolbars change the visible height.

Rules

  • Do not add user-scalable=no or maximum-scale=1; they block pinch zoom, which harms low-vision users.
  • vw and vh size against the layout viewport, and on mobile vh usually matches the large viewport with toolbars hidden, so 100vh can overflow. Use dvh (dynamic, tracks toolbars), svh (small, always fits), or lvh (large). All are supported in current browsers.
  • Use container queries for component sizing and viewport units for page-level layout (container-query).
.hero { min-height: 100dvh; }