๐Ÿ“ฑ Solved: iOS Home Screen web app (PWA) gap at the bottom in portrait

Your PWA, added to the iPhone Home Screen and opened upright, stops one status bar short of the bottom edge. Here is what we measured, the CSS fix that removed it, and everything that did not work. ๐Ÿฉน

โœ… Solved on iPhone, iOS 18.2 ยท Last updated

iPhone PWA with a red empty gap at the bottom (root 100dvh) next to one filled to the edge (root 100vh), with the CSS fix

โšก TL;DR: the fix

If your page has viewport-fit=cover, apple-mobile-web-app-status-bar-style set to black-translucent, and a root sized with 100dvh (or 100%), size the root with 100vh in the installed app only:

/* iOS PWA bottom gap fix: github.com/LivingSparks10/ios-pwa-status-bar-gap */
html, body { height: 100%; height: 100dvh; }   /* browser tab */

@media (display-mode: standalone), (display-mode: fullscreen) {
  html, body { height: 100vh; }                /* Home Screen app: full screen */
}

iOS still launches the app short, then grows it to the full screen within about a second (0.4โ€“0.9 s in our tests) and fires a resize. No need to add the icon again: iOS reads the CSS at every launch. โœ…

โ˜• This fix took 25 launches and 21 phone rotations to find. If it saved you time: buy me a coffee on Ko-fi.

๐Ÿงช Try it on your iPhone

Two test pages that differ only in the root's height. Open each one in Safari, tap Share โ†’ Add to Home Screen, then open the new icon with the phone upright.

๐ŸŸฅ dvh.html: root 100dvh (shows the band) ๐ŸŸฉ vh.html: root 100vh (the fix)

Green to the bottom edge means no band; a red band at the bottom is the bug.

๐Ÿ” The symptom

People describe it as: PWA white bar at the bottom, gap at the bottom of a standalone web app, bottom safe area not filled, 100dvh too short in PWA, empty space below the content on iPhone after Add to Home Screen. It is the same thing.

๐Ÿ“ What we measured

The page logged its viewport to a server at every launch and every event, plus every 100 ms for the first seconds. iPhone with a 430 ร— 932 pt screen, iOS 18.2, December 2026. At launch in portrait, root at 100dvh:

MeasureAt launchAfter rotating and back
innerHeight, visualViewport.height873932
100dvh / 100svh873 / 873932 / 873
100vh / 100lvh932 / 932932 / 932
documentElement.clientHeight873873
env(safe-area-inset-top) / -bottom59 / 3459 / 34
display-mode, navigator.standalonefullscreen, truesame

So iOS already knows the full height at launch: 100vh is 932. Only the viewport the page lives in is short.

๐Ÿ”ฌ The variants

The server served a different variant at each launch; the tester only relaunched the app and marked what they saw.

VariantHeight after 4 sBand
original (root 100dvh, overflow: hidden)873๐Ÿ˜ฉ yes
root 100vh932๐ŸŽ‰ no (2 of 2)
root with no height and no overflow873yes (2 of 2)
viewport meta of a page that fills the screen873yes
viewport meta with height=device-height, shrink-to-fit=no873yes
no theme-color meta873yes

Then the fix in the real app, scoped to display-mode: standalone and fullscreen: 3 launches out of 3 without the band, with rotations back and forth. It launched at 873 and reached 932 after 398, 714 and 857 ms.

๐Ÿšซ What did not work

AttemptResult
App elements at 100lvh (932), root at 100dvhElements are 932 tall, the band stays: nothing is drawn past 873
Status bar default or blackThe band moves to the top and becomes an opaque status bar
Manifest without orientation, standalone instead of fullscreenSame band
Rewriting the viewport meta at runtime, scrollTo, a fake resize, focus/blur tricksinnerHeight stays 873
Laying the page out with screen.heightContent past 873 is cut off โœ‚๏ธ

Many write-ups conclude that no CSS can fix this and switch the status bar to default, giving up the full screen. On our iPhone the root's height unit made the difference.

๐Ÿค” Why it works (our reading, not confirmed by Apple)

At launch in portrait, the app starts one status bar short. iOS then seems to size the app to fit the page: a root of 100dvh matches the short viewport, so nothing changes. A root of 100vh (932) is taller than the app, and iOS grows the app to the full screen. This is an observation, not documented behaviour.

๐Ÿงญ Things to know when you apply it

๐Ÿซ  The cost of this bug

A game that worked fine, except for one band at the bottom. It took more hours than we'd like to admit. The real numbers from the debug log:

๐Ÿš€ App launches logged25
๐Ÿ”„ Phone rotations logged21 (plus countless unlogged ones out of spite)
๐Ÿงช Variants written / tried on the phone14 / 9
๐Ÿ“ Lines of viewport log375
๐Ÿ—‘๏ธ Test icons added to and removed from the Home Screenlost count
๐ŸŽฎ Unrelated web games opened โ€œfor researchโ€a few (one of them filled the screen, so a fix had to exist)
โœ๏ธ Characters in the final fixabout 30

If this saved you from rotating your phone 21 times, a coffee is very welcome โ˜•

โ˜• Buy me a coffee on Ko-fi

๐Ÿ“ฎ Reports from other devices

Tested so far on one iPhone (430 ร— 932 pt), iOS 18.2. Reports from iOS 26 and 27 describe a band that no element can reach, possibly a different regression. Tell us what dvh.html and vh.html show on yours: open a device report ๐Ÿ™

๐Ÿ”— Related