CalNote May 17, 2026 · iOS · PWA · CSS

The one-line CSS that makes your iOS PWA truly full-screen

A bug that's haunted iOS PWAs for years, and the hack that finally fixes it without breaking the home indicator.

You've got the meta tags right. display: standalone in the manifest. apple-mobile-web-app-capable: yes. viewport-fit=cover. apple-mobile-web-app-status-bar-style: black-translucent. You're padding the safe areas with env(safe-area-inset-top) and env(safe-area-inset-bottom). Your root element is height: 100svh, or 100dvh, or both.

You add your app to your iPhone's home screen, launch it… and there's still a stubborn strip of page background showing at the bottom. The app doesn't reach the bottom of the screen. It looks almost native — almost.

This is the bug that drove us to dig in while polishing CalNote, our minimal calendar-and-notepad PWA. Here's what's actually going on and the one-line CSS that fixes it.

The cause

When iOS Safari decides how much of the screen to give a page, it considers whether the page is scrollable. A short, non-scrolling page gets a slightly smaller visual viewport than the physical screen — historically this is the mechanism that auto-hides the address bar when the user scrolls.

In standalone PWA mode there's no address bar to hide, but the heuristic remains. If your page content fits inside the (smaller) initial viewport, iOS never promotes you to the full screen. Your bottom-edge content ends up a few dozen pixels above the actual screen bottom, and the page background shows through.

None of the viewport units fix this on their own. 100svh, 100dvh, 100lvh all just resolve to whatever iOS has decided the viewport is. The viewport itself is the wrong size.

The fix

Make the document just barely taller than the viewport. iOS sees content overflow, promotes the page to "scrollable" status, and the visual viewport becomes the full screen. Clip the overflow so it isn't actually scrollable.

html {
  min-height: calc(100% + env(safe-area-inset-top));
  overflow: hidden;
}

body {
  overflow: hidden;
}

.app-root {
  height: 100dvh;
}

That's it.

The min-height trick has been floating around in various forms since iOS 11 introduced safe-area insets. Adding env(safe-area-inset-top) worth of extra height is generous enough to trigger the promotion on every iPhone we tested (notch and Dynamic Island devices alike). overflow: hidden on both html and body means the user can't actually scroll into the oversize. With the viewport now equal to the real screen, height: 100dvh on your root element finally reaches the bottom.

The position: fixed pitfall (iOS 17+)

You'll find plenty of older write-ups suggesting position: fixed; inset: 0 on the root as a way to "pin" to the viewport. Don't. On iOS 17+ there's a documented PWA bug where position: fixed on the root introduces its own bottom gap — different mechanism, identical visible symptom. We hit this exact rabbit hole before landing on the min-height trick.

The Apple Developer Forums have a thread on this — iOS17 PWA position: fixed bug — if you want the gory details.

Tuning how far the content extends

One subtlety: once the viewport expands to the full screen, your content has more vertical room — and on Dynamic Island devices that means content can crowd the home indicator's gesture area. The clean fix is to let your bottom container claim only some of the newly granted space and reclaim the rest as padding:

.app-root {
  padding-bottom: max(0px, calc(env(safe-area-inset-top) - 40px));
}

This lets your content extend ~40 pixels past where it used to bottom out, then pads the rest. On a Dynamic Island iPhone (safe-area-inset-top ≈ 59px) that's 19px of bottom breathing room. On a notch iPhone (~47px) it's 7px. On Android or desktop where there's no inset, the max(0, …) clamps to zero and the layout is unchanged.

The full recipe

Putting it all together — what you need in index.html and style.css for a PWA that reaches the bottom of the screen on iOS:

<!-- index.html -->
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

<!-- manifest.json -->
{ "display": "standalone", ... }
/* style.css */
html {
  min-height: calc(100% + env(safe-area-inset-top));
  overflow: hidden;
}

body {
  overflow: hidden;
}

.app-root {
  height: 100dvh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: max(0px, calc(env(safe-area-inset-top) - 40px));
}

Why it isn't more widely documented

Most PWA tutorials cover meta tags and safe-area-inset. Few mention the min-height trick by name. The ones that do are scattered: a 2021 dev.to post by Karma Sakshi, an old GitHub issue, a Stack Overflow answer with three upvotes. None of them combine the trick with the position: fixed warning, which means a lot of teams independently discover the bug, try the wrong fix, and ship something subtly broken.

Hopefully this post is the one that lands when the next developer Googles "iOS PWA bottom gap." If it saves you an evening, we built CalNote to save you the rest. Try it →

References