# Fixing 100vh on Mobile: dvh, svh and lvh Explained

> Why height 100vh is taller than the visible screen on phones, and when to use the dvh, svh and lvh viewport units instead. With copy-ready CSS.

Canonical: https://ihatebugs.dev/guides/mobile-100vh-fix
Last updated: 2026-10-17

Updated 2026-10-17.

**On phones, `100vh` is the height of the viewport with the browser's address and tool bars hidden, so a `100vh` section is taller than the screen while the bars are showing. Use `100svh` (small viewport height) for content that must fit with the bars visible, `100dvh` (dynamic) when the size should follow the bars as they appear and hide, and `100lvh` (large) when you want the old behaviour.** All three units work in current Chrome, Safari, Firefox and Edge.

## Why 100vh overflows on phones

Mobile browsers shrink their address bar as you scroll. To stop pages jumping, they define `vh` against the largest possible viewport, the one with the bars hidden. When the page first loads, the bars are visible, so the bottom of a `100vh` hero sits under the browser's toolbar. Buttons placed at the bottom of the hero are cut off.

## The three viewport heights

| Unit | Height it uses | Changes while scrolling? |
| --- | --- | --- |
| `svh` | Bars visible (smallest) | No |
| `lvh` | Bars hidden (largest), same as `vh` on phones | No |
| `dvh` | Whatever is visible right now | Yes |

Matching width units exist too (`svw`, `lvw`, `dvw`), along with `svmin`, `dvmax` and the rest ([MDN](https://developer.mozilla.org/docs/Web/CSS/length#relative_length_units_based_on_viewport)).

## Which one to use

- **Hero or landing section:** `min-height: 100svh`. It fits the first screen exactly and doesn't resize as the user scrolls, so nothing jumps.
- **App-like full-screen layout** (chat, map, editor): `height: 100dvh`, so the layout always fills exactly what's visible.
- **Background or decoration:** `100lvh` (or plain `vh`), so it never leaves a gap when the bars hide.

Animating anything tied to `dvh` makes layout recalculate as the bars move, which can stutter. Prefer `svh` unless you need the live size.

## Copy-ready CSS

```css
.hero {
  min-height: 100vh; /* older browsers */
  min-height: 100svh;
}

.app-shell {
  height: 100vh;
  height: 100dvh;
}
```

The second declaration wins where the new unit is supported; older browsers ignore it and keep `vh`.

## Test it

The bug only shows with browser bars on screen. The [Mobile Simulator](https://ihatebugs.dev/mobile-simulator) can draw the status and browser bars, so the page gets the shorter height it has in a real phone browser; turn them off to compare against the full viewport. Check a short phone such as the [iPhone SE (3rd gen)](https://ihatebugs.dev/devices/iphone-se-3) and a tall one such as the [Pixel 9 Pro XL](https://ihatebugs.dev/devices/pixel-9-pro-xl).
