Skip to main content
InterviewHubPRO
Section Overview
Q12

Question 12 of 50

Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

24%
CSS3 & Modern Layouts (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

Understanding Modern CSS Viewport Units: `vh` vs. `svh` vs. `lvh` vs. `dvh`.

junior LevelcssBasic

In Simple Words: On mobile browsers (iOS Safari, Android Chrome), dynamic browser address bars slide in and out as you scroll, making traditional 100vh break layouts (overflowing off-screen). Modern CSS provides 3 dynamic viewport units:

  • svh (Small Viewport Height): Height when mobile address bars are expanded and visible (the smallest possible viewport area).
  • lvh (Large Viewport Height): Height when mobile address bars are retracted and hidden (the largest possible viewport area).
  • dvh (Dynamic Viewport Height): Dynamically recalculates as the address bar animates in and out.
  • Best practice for full-screen hero sections: min-height: 100dvh;.