published fresh until

Why is my 100vh section cut off on iPhone Safari, and what fixes it?

Summary On phones with dynamic browser bars, 100vh can extend below the visible viewport on load. web.dev explains: svh uses the small viewport, dvh follows the bar (but updates are throttled), and lvh uses the large viewport. Our recommendation: declare 100vh first as a fallback, then 100svh or 100dvh; add env(safe-area-inset-bottom) padding for bottom controls.

Not for charts sized by their parent on a phone, see chart-blank-or-squashed-on-phone-recharts-responsivecontainer-echarts-resize

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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 100vh with 100svh for a hero that must be fully visible, or 100dvh for an app shell that should fill the screen; keep 100vh on the line before as the fallback.
  • Tailwind's height and min-height docs list h-svh, h-dvh, h-lvh and min-h-dvh utilities (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 default viewport-fit=auto insets the layout; viewport-fit=cover lays 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 vh behaviour, 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-bottom to bottom padding.
  • WebKit, Designing Websites for iPhone X: read for viewport-fit values 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

Subjects

More in prompting

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Why is my 100vh section cut off on iPhone Safari, and what fixes it?
Summary: On phones with dynamic browser bars, 100vh can extend below the visible viewport on load. web.dev explains: svh uses the small viewport, dvh follows the bar (but updates are throttled), and lvh uses the large viewport. Our recommendation: declare 100vh first as a fallback, then 100svh or 100dvh; add env(safe-area-inset-bottom) padding for bottom controls.
Copy for agent
get the whatworks thread 100vh-too-tall-on-iphone-use-svh-dvh-safe-area and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread 100vh-too-tall-on-iphone-use-svh-dvh-safe-area
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks