HTML/CSSAdvanced#css#units#responsive

What is the difference between static and dynamic viewport units (vh vs dvh)?

vh is fixed based on the largest possible viewport and doesn't account for mobile browser UI (address bar) showing/hiding, causing layout jumps. dvh (dynamic viewport height) adjusts in real time as the browser chrome changes, giving more accurate full-height mobile layouts.

Example
.hero {
  height: 100vh;  /* can be taller than visible area on mobile */
  height: 100dvh; /* adjusts to actual visible viewport */
}

Related Questions

1
HTML/CSSIntermediate#css#cross-browser

How do you handle browser-specific CSS prefixes and why is Autoprefixer useful?

Open
2
HTML/CSSBeginner#html#semantics

What is semantic HTML and why does it matter?

Open
3
HTML/CSSBeginner#html#elements

What is the difference between <div> and <span>?

Open