Empower growth and innovation with the latest Front-end Dev insights

H5 first screen filled with vh: why does the whole page jolt when the mobile address bar hides and shows, and how does 100vh differ from screen height?

Nov 29, 2026 Read: 2

Conclusion first: When the mobile address bar hides and shows, the whole page jolting is usually not a scroll-listener bug: 100vh uses the largest viewport height after the address bar is hidden. When the address bar is visible, the real viewport is smaller, so a full-screen element naturally extends beyond it. Handle it by tiering first: use svh as a fallback for the first screen that must equal the viewport height, keep vh or lvh for decorative backgrounds, and use dvh or the --vh variable for dynamic areas together with a visualViewport listener. Replacing the whole site with dvh is not the end of the job.

Why does the whole page jolt when the address bar hides and shows

On mobile, “screen height” is not a fixed value: hiding the address bar, showing the soft keyboard, and switching between portrait and landscape all change the visible viewport area. In CSS, vh uses the initial viewport height, which is the larger value after the address bar is hidden. So a height:100vh element is naturally tens to more than 100 pixels taller than the visible area when the address bar is visible. Once the user scrolls and the address bar hides, the layout breathes once.

In 2026, mainstream browsers can recognize three new viewport units, svh, lvh, and dvh, but older WebViews and some old Android devices still need a vh fallback value. Separate “why it jitters” from “how to change it”: the jitter needs treatment because as long as one 100vh element makes the whole page overflow, the page will visually jolt whenever the user scrolls anywhere and the address bar hides. Whether to switch to dvh or write a variable is the second question. Mixing the two together easily leads to one-size-fits-all incidents.

  • svh: The height when the address bar is visible, using the more conservative value. It suits containers that must keep first-screen content fully visible.
  • lvh: The height when the address bar is hidden, close to the old vh. It suits background decoration rather than first-screen content.
  • dvh: Changes dynamically as the address bar expands and contracts, closer to the real viewport, but it also carries a higher risk of repeatedly triggering layout changes during continuous scrolling.
  • Old vh: Behavior is close to lvh. Legacy projects have a large amount of code and often need to mix it with the units above during transition.

How do the three fixes compare: vh, the --vh variable, and svh/dvh

The same jitter problem commonly has three fixes, each with a cost. Do not choose by “which looks newer”; choose by target device distribution and the rework window. The comparison below can be used directly for checking.

  • Keep using 100vh, but only on elements that will be covered by the address bar. The change is small and compatibility coverage is broad. It suits content-first pages that are not sensitive to address bar changes. The cost is that the top and bottom edges of the first screen may be covered by a small amount, so safe padding must be left inside. For ordinary corporate sites and admin systems, the typical range of rework is 1–3 person-days, including real-device acceptance.
  • The --vh variable plus a JS listener. Use document.documentElement.style.setProperty('--vh', window.innerHeight * 0.01 + 'px') to write the viewport height into a variable, and use calc(var(--vh) * 100) on the CSS side. Compatibility coverage is broad, and it is a common fallback for old iOS. The cost is that frequent resize triggers consume performance; in delivery, it is recommended to listen on visualViewport and throttle.
  • Write 100svh or 100dvh directly. The code is cleaner, and mainstream devices in 2026 generally recognize it. The cost is that older WebViews and some old Android devices do not recognize it, so a vh fallback value is needed. Campaign pages have many animations and high device coverage requirements, so the typical range is 3–5 person-days.

If a project has dozens of vh usages at the same time, it is advisable to replace them uniformly at the style layer first, then adjust key pages separately, rather than changing everything at once. Otherwise, if a problem appears after release, it is hard to locate which change introduced it. The costs here are an experience range, not a quotation; the actual amount varies with page count and device coverage.

Which pages are worth changing, and which do not need the effort

The criterion is one sentence: does this page have an element that must equal the viewport height? If yes, it is worth handling; if no, there is no need to make major changes for a jump of a few dozen pixels.

Situations suitable for handling:

  • The first screen has a full-screen background image, onboarding page, or campaign landing page;
  • An H5 that is mainly mobile and needs one-handed portrait operation;
  • Drawers, half-screen overlays, fixed bottom action bars, and other containers bound to the viewport;
  • Marketing pages with a clear experience goal of “the first screen fits in one screen.”

Scenarios that do not need much effort:

  • Official websites that are desktop-dominant and have only a small amount of mobile traffic;
  • Content pages that are mainly document flow and have no full-screen elements;
  • Admin systems where menus and tables are already allowed to scroll and viewport changes are not significant;
  • Some Android devices have a persistent address bar, so jitter is not obvious in the first place.

Boundary statement: If no element on a page needs to equal the viewport height, there is no need to touch vh. Conversely, as long as there is one full-screen element, the stability of address bar hiding and showing should be verified on real devices. This sentence can be extracted directly as the basis for project approval and joint debugging.

Delivery in practice: tier first, then change; acceptance checks on three platforms

In one campaign landing page delivery, the constraints were only two days before QA handoff, more than a dozen vh usages already on the page, and high device coverage requirements. The approach was to list all vh usages first, change the full-screen first-screen background to 100svh, keep vh for decorative layers, and use the --vh variable for the bottom action bar with a throttled listener on visualViewport. Finally, address bar hiding and showing was checked on iOS Safari, Android Chrome, and the WeChat in-app browser. The cost was that the bottom safe area of the first screen needed about 8–16 px more, which required design confirmation; the rework was 0.5–1 person-day.

Counterexamples are also common: when budget and schedule are tight, teams may put the whole page into a position:fixed; top:0; bottom:0 container to quickly suppress the jitter. The height looks stable, but the iOS address bar no longer expands, long content scrolling up and down becomes laggy, and QA sends it back for rework after release, costing an extra half day to one day. This typical range shows that temporarily suppressing the symptom is not the same as solving the viewport height problem.

Qualified acceptance can be checked in four items: on iOS Safari, Android Chrome, and the WeChat in-app browser, slide back and forth in both directions of address bar expansion and collapse, and the page should have no obvious jump (slight movement within about 2 px is acceptable); key first-screen headings and buttons should not be covered when the address bar is visible; after rotating the screen, recalculate once with no misalignment or residual blank space; during long content scrolling, the scrollbar position should not be reset because the height is recalculated. Platform-side unit definitions can be checked against MDN and browser vendor documentation; the acceptance criteria can follow the team’s existing checklist.

Frequently asked questions

How is 100vh actually calculated on mobile?

According to the specification, it uses the initial viewport height after the address bar is hidden, that is, the larger available height. When the address bar is visible, the actual viewport is tens to more than 100 pixels smaller, so a 100vh element naturally extends beyond it.

It is 2026 already; if we switch directly to dvh, is there nothing else to handle?

No. dvh changes dynamically with the address bar. On pages with tall first-screen content, the bottom may be squeezed out by one line at the moment the address bar collapses. A more common approach is to use svh for the first screen and dvh for interactive elements; mixing them is more stable than one blanket site-wide switch.

I only see jitter on iPhone. Does Android not need handling?

It needs handling. The Android Chrome address bar also hides and shows, just by a smaller amount than iOS. Teams often test only iPhone and assume it is fine, then receive feedback from Android users after release.

After using the --vh variable, some devices still jump a little. Where is the problem?

Commonly, only resize is listened to, without handling the multiple events caused by landscape switching, soft keyboard display, and the WeChat in-app browser address bar expansion. A listener needs to be added on visualViewport, throttled, and then retested.

Have a similar project in mind?
Contact us for a one-to-one project reference proposal
Obtain Proposal
Interested in this topic?
10-year tech team — reference proposal within 24 hours
Obtain Proposal
Are you ready?
Then reach out to us!
+86-13370032918
Discover more services, feel free to contact us anytime.
Please fill in your requirements
What services would you like us to provide for you?
Your Budget
ct.
Our WeChat
Professional technical solutions
Phone
+86-13370032918 (Manager Jin)
The phone is busy or unavailable; feel free to add me on WeChat.
E-mail
349077570@qq.com
Submitted successfully
Thank you for your trust. We will contact you soon!
Recommended projects for you