Viewport units: plainly explained.

Viewport units (vw, vh, vmin, vmax, dvh) size elements relative to the screen. The units, the mobile 100vh problem, and best practices.

Design · Updated Nov 7, 2026

DEFINITION

Viewport units (vw, vh, vmin, vmax) size elements relative to the screen, so 1vw equals 1% of the viewport width, making layouts and type scale fluidly.

CATEGORY

Design

RELATED

Responsive design, CSS unit

Summarize this page with AI

Viewport units size elements relative to the browser viewport rather than a parent or the root font. 1vw equals 1% of the viewport width and 1vh equals 1% of its height, so an element sized in viewport units scales fluidly as the screen changes. They power full-height sections, fluid typography and layouts that adapt without a breakpoint.

01

The main units

Unit
vwRelative to1% of viewport widthExamplewidth: 50vw
vhRelative to1% of viewport heightExampleheight: 100vh
vminRelative to1% of the smaller sideExamplefont-size: 5vmin
vmaxRelative to1% of the larger sideExamplepadding: 2vmax
dvhRelative to1% of the dynamic viewport heightExampleheight: 100dvh
02

The mobile viewport problem

On phones, the address bar shows and hides as you scroll, so the classic 100vh can be taller than the visible area and cause a jump. Newer units fix this: svh (small), lvh (large) and dvh (dynamic) track the real viewport, and 100dvh is now the safe way to make a section fill the mobile screen.

03

Common uses

  • Full-height hero sections with min-height: 100dvh.
  • Fluid typography, usually inside clamp() so it never gets too small or too large.
  • Spacing and imagery that scale with the screen.
04

Viewport units versus percentages and rem

A percentage is relative to the parent element, rem is relative to the root font size, and a viewport unit is relative to the screen. Use percentages for layout inside a container, rem for accessible type and spacing, and viewport units when something should scale with the whole screen.

05

Pitfalls and best practices

100vw can be slightly wider than the visible area when a scrollbar is present, causing horizontal overflow, so prefer 100% for full-width blocks. Avoid sizing body text in pure vw because it can break zoom and accessibility; wrap it in clamp() with a rem floor instead.

06

Viewport units at BeBranded

At BeBranded we use viewport units for fluid heroes and type that scale cleanly across screens, always guarded for mobile and accessibility. It is part of the responsive craft in our design work.

FAQ

Questions about Viewport units.

Another question?

Write to us
What are viewport units?
Viewport units size elements relative to the browser viewport. 1vw is 1% of its width and 1vh is 1% of its height, so elements scale fluidly with the screen.
What is the difference between vw and percentage?
A percentage is relative to the parent element, while vw is relative to the whole viewport width. So 50% depends on the container, but 50vw is always half the screen width.
What is 100dvh?
100dvh is 100% of the dynamic viewport height, which tracks the real visible area on mobile as the address bar shows and hides. It fixes the classic 100vh jump on phones.
What are vmin and vmax?
vmin is 1% of the smaller viewport side and vmax is 1% of the larger side. They are handy for elements that should scale with whichever dimension is limiting.
Should I size text in vw?
Not on its own, because pure vw text can break zoom and accessibility. Wrap it in clamp() with a rem minimum so it stays readable and still scales with the screen.
Does Webflow support viewport units?
Yes. You can set sizes in vw and vh in the Designer, and add newer units like dvh through custom properties or custom code.

Related

Related terms, and where to go next.

GSAP: complete guide to web animation in 2026
Design

GSAP: complete guide to web animation in 2026

GSAP (GreenSock): definition, key plugins, Webflow acquisition, practical integration, CSS animation comparison, and how to get started.

Read the article
BeBranded
Development

Figma to Webflow: plugin or Client-First rebuild in 2026

Figma to Webflow plugin or manual Client-First rebuild? Comparison, recommended workflow, and real-world scenarios to ship fast without sacrificing quality.

Read the article
How to easily create circular text on your Webflow site
Webflow

How to easily create circular text on your Webflow site

Discover how to add a creative touch to your website with circular text using the Figma "Arc" extension. Follow our guide to enhance your site.

Read the article

Let’s talk

Tell us what you want to build.

Thirty minutes with the people who will work on your project. You leave with a clear view of the scope, the timeline and the next steps.

What happens next

  1. 1A 30-minute callWe listen to your goals, your constraints and your context.
  2. 2A clear scopeWe map what is worth doing first, and what it takes.
  3. 3A costed proposalYou decide, with no commitment and no sales pitch.