DEV Community

Anton Zaharenko
Anton Zaharenko

Posted on

New CSS Units: svh, lvh, and dvh

For a long time, using 100vh seemed like the perfect solution for responsive layouts.
But on mobile devices, things turned out to be more complicated:
dynamic browser address bars would shrink the viewport,
causing layouts to jump unexpectedly.

To fix this, CSS introduced three new units:
svh measures the viewport height immediately after the page loads.
lvh represents the maximum available viewport height, for example, after the address bar collapses.
dvh reflects the real-time dynamic viewport height as the user interacts with the page.

With these updates, responsive layouts are more stable, content no longer shifts unexpectedly on mobile, and the user experience is significantly improved.

If you want your websites to feel polished and professional across all devices, it is time to start using these new units.

CSS #Frontend #WebDevelopment #ResponsiveDesign

Top comments (0)