What is Dynamic Viewport Units Generator?
Modern CSS viewport units come in three variants. Small viewport (svh) is the viewport height minus the browser UI. Large viewport (lvh) is the viewport height with the browser UI retracted. Dynamic viewport (dvh) adjusts as the browser UI appears and disappears. These are useful for full-screen layouts on mobile where the browser address bar changes the visible area.
Quick answer
Use dynamic viewport units (dvh, svh, lvh) for layouts that need to fill the mobile viewport correctly when the browser UI expands and retracts. Always include a classic vh fallback for older browsers.
Limitations
- Dynamic viewport units are only relevant on mobile browsers where the address bar and other UI elements expand and retract. On desktop, dvh, svh, and lvh behave identically to vh.
- Some browsers update dvh on scroll end rather than continuously, which may cause a visible jump in element height as the address bar retracts.
How to use this tool
- Choose the unit type: svh, lvh, dvh, svw, lvw, or dvw.
- Set a percentage value for the viewport unit such as 100 for full height.
- Choose the CSS property to apply the viewport unit to, such as min-height or height.
- Copy the CSS declaration with the modern unit and a classic vh fallback.
What you can use it for
- Create a hero section that fills the exact visible screen on mobile devices.
- Prevent content from being hidden behind the mobile browser toolbar on scroll.
- Build full-screen panels that adapt to changing viewport sizes as the browser UI appears and retracts.