What this thread does
The problem
A layout built with 100vh can extend below the visible viewport on a phone with expanded browser toolbars. Tailwind's h-screen sets height: 100vh.
What web.dev says
web.dev's viewport units article: browser UI expands and retracts on phones and plain vh ignores that, so a 100vh element can bleed out of view on load. Three units account for those toolbar states:
lvh: the large viewport, as if the bar is retracted.svh: the small viewport, as if the bar is expanded, the stable one.dvh: dynamic; matches whichever state the bar is in. Updates are throttled as the browser UI expands or retracts.
As of November 2026, the article lists support starting with Chrome and Edge 108, Firefox 101, Safari 15.4. In browsers without dynamic browser UI, such as Chrome on desktop, all three are equal.
What to tell the agent
- Our recommendation: replace
100vhwith100svhfor a hero that must be fully visible, or100dvhfor an app shell that should fill the screen; keep100vhon the line before as the fallback. - Tailwind's height and min-height docs list
h-svh,h-dvh,h-lvhandmin-h-dvhutilities (checked 2026-11-30; our recommendation: check your installed version). - Our recommendation for fixed footers: add bottom safe-area space with
padding-bottom: calc(1rem + env(safe-area-inset-bottom)). MDN's env() example adds the bottom inset to a sticky footer's padding. WebKit's iPhone X post says the defaultviewport-fit=autoinsets the layout;viewport-fit=coverlays out to the full screen, after which padding should respect the safe area. Our recommendation: test your chosen viewport setting and padding on a device. - Our recommendation: test on a real phone or the iOS simulator, including with the browser bar expanded and retracted; do not rely only on desktop responsive mode.
Our recommendation — a prompt worth trying (untried): "Find every 100vh, h-screen and fixed-bottom element. Switch full-height ones to svh or dvh with a vh fallback, and add safe-area padding to the fixed ones."
Common mistakes
Our recommendation: avoid relying on dvh for smooth scroll-linked animation; keep the fallback line and check beyond desktop devtools.
Limits
I did not run these prompts or reproduce the bugs; the CSS behaviour is from the cited docs, checked 2026-11-30.
Primary source
Primary sources: The large, small, and dynamic viewport units (web.dev, Bramus) and env() (MDN Web Docs). web.dev explains that vh ignores the retracting browser UI so a 100vh element is too tall on load, that dynamic units are throttled rather than continuous, and the support versions listed above. MDN shows the footer example padding: 1em 1em calc(1em + env(safe-area-inset-bottom)).
Sources
- web.dev, The large, small, and dynamic viewport units (web.dev/blog/viewport-units, by Bramus, last updated 2022-11-29): read; checked the
vhbehaviour, the three units, the throttling remark and the support list (Chrome and Edge 108, Firefox 101, Safari 15.4). - MDN, env(): read; the sticky-footer example adds
safe-area-inset-bottomto bottom padding. - WebKit, Designing Websites for iPhone X: read for
viewport-fitvalues and safe-area padding. - Tailwind docs, height and min-height: read for the utilities.
- Not checked: rendering on a real iPhone or simulator, and the prompt, which is untried.
Started from a post by @Stack Overflow question by Nereo Costacurta; web.dev viewport units article, packaged by the editor. Original post