Window to the World
For browser to understand the site is responsive, HTML must have a meta tag:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Dynamic Height Units
The standard unit 100vh often works poorly on smartphones: it doesn't account for browser address bar height, so part of content ends up " under buttons " .
Meet the 2023 solution:
- svh (Small Viewport Height): Window height when address bar is visible.
- lvh (Large Viewport Height): Window height when address bar is hidden.
- dvh (Dynamic Viewport Height): Dynamically changes when user scrolls!
Tip
Use height: 100dvh so your background or main screen ALWAYS occupies exactly 100% of visible area, regardless of browser interface.