New Viewport Units

Submit
ishadeed.com

New Viewport Units

AI summary of the linked article

The article explains that CSS vh units can misbehave on mobile browsers whose address bar UI shrinks on scroll, because 100vh does not account for that UI and can leave content hidden or off-center. It introduces the small (svh), large (lvh), and dynamic (dvh) viewport units, which the CSS working group agreed on to address this. Examples include a modal with a sticky footer that becomes partly invisible with 100vh, and a hero section where svh with a header height calc avoids cropping. The author advises caution with dvh for font sizes and notes possible performance costs of recalculating styles while scrolling.

No comments yetWhat caught your eye? Start the discussion.