Full-Height Hero Cut Off on Phones: Switching From vh to dvh Step by Step
Short answer: On a phone, the browser toolbar slides away as you scroll, so the visible area changes size. Plain 100vh means the tallest possible viewport, with the toolbar hidden, which pushes the bottom of your hero, and often its call-to-action button, below the visible fold on first load. Switch to min-height: 100svh if you want the hero always fully visible, or 100dvh if you want it to follow the toolbar as it moves. Keep a 100vh line above as a fallback for older browsers.
Why the old unit misbehaves
The vh unit was defined as one percent of the viewport height. On desktop that is simple. On a phone the "viewport" can be measured two ways: with the address bar showing or with it collapsed. Browsers chose the collapsed measurement for vh so that the layout would not jump when the bar disappears. The result is that on first load, with the bar visible, a 100vh element is taller than the screen by the height of the bar, usually around 56 to 100 pixels depending on device.
A hero with a heading at the top and a button at the bottom therefore shows the heading and loses the button until the visitor scrolls. For an Australian tradie's site whose only job on the first screen is to get a tap on "Call now", that is a real loss.
The three newer units
| Unit | Stands for | Behaviour | Good for |
|---|---|---|---|
svh |
Small viewport height | Height with toolbars fully shown | Heroes that must never be clipped |
lvh |
Large viewport height | Height with toolbars hidden, same as classic vh |
Backgrounds that fill the screen once scrolled |
dvh |
Dynamic viewport height | Changes as toolbars show and hide | Layouts that should always match the visible area |
Each also has width equivalents (svw, lvw, dvw) that rarely matter. As of November 2026 these units are supported across the current versions of the major mobile and desktop browsers, but verify on the MDN page if you must support older handsets.
Step by step
1. Reproduce the problem on a real phone
Desktop browser emulation does not reproduce the collapsing toolbar reliably. Open your site on an actual phone, load the page fresh, and look at the bottom of the hero. Note what is missing. Then scroll a little and see whether anything jumps.
2. Find the declarations
Search your stylesheet and any page-builder custom CSS for 100vh, height: 100% chains and vh values on body, .hero or section. Page builders often store the setting as "Full height" or "Min height 100 vh" in a panel; note where.
3. Decide: fixed or following
Ask whether the hero's content must always fit. If it contains a heading, a short sentence and a button, choose svh. The hero will be slightly shorter once the toolbar hides, which looks fine. If the hero is a full-bleed image with no critical content at the edges and a jumping size would look odd on scroll, choose lvh. Pick dvh only when you really want the section to resize as the toolbar moves, and accept that content may shift while scrolling.
4. Write it with a fallback
.hero {
min-height: 100vh; /* fallback for old browsers */
min-height: 100svh; /* modern browsers use this line */
}
Browsers that do not understand svh ignore the second line and keep the first. Use min-height, not height, so a large text size or a long translation can still grow the section instead of overflowing.
5. Check the content inside
Vertical centring with flexbox inside the hero is fine. Avoid absolute positioning that pins the button to the bottom edge with a fixed pixel offset; use padding and justify-content so the button follows the content when the section grows.
6. Test in four situations
- [ ] Fresh load in portrait with the toolbar showing.
- [ ] After scrolling down and up so the toolbar has hidden and returned.
- [ ] Landscape orientation, where height is scarce and a tall hero should still let content flow.
- [ ] Text zoom at 150 percent, which often exposes clipping that
heightintroduces.
Mistakes people make during the switch
Replacing every vh on the site is unnecessary. A decorative 50vh banner that is not critical can stay. Using dvh for the whole body height can cause repeated layout work while scrolling, so reserve it for one section. Setting overflow: hidden on the hero to "tidy" the overflow hides the button instead of fixing the cause. And do not rely on a JavaScript snippet that writes window.innerHeight into a CSS variable unless you must support old devices; it runs late and can flash the wrong height on first paint.
When the hero contains a form
Keyboards matter. When the on-screen keyboard opens, some browsers shrink the visual viewport but not the layout viewport, and others resize both. A hero containing an enquiry form should not depend on being exactly one screen tall. Use min-height, allow scrolling, and test typing into the lowest field so the submit button remains reachable.
FAQ
Is 100svh always better than 100vh?
For content that must be visible, yes, because it never exceeds the visible area. For purely decorative backgrounds the difference is small and either works.
Will the change affect desktop visitors?
No. Without a collapsing toolbar all three units evaluate to the same height as vh.
My page builder only offers vh in a dropdown. What now?
Leave the setting at its minimum and add a custom CSS rule on that section with the fallback pair shown above. Most builders let you add a class.
Can I use dvh to fix the jumping on iPhone?
It makes the section follow the toolbar, which removes the gap but introduces movement. If the movement bothers you, svh is calmer.
If a full-screen section on your site is hiding its main button on phones, tell us about it through our enquiry page and we will take a look.