vi
A hundredth of the viewport along the inline axis, the direction text runs in.
Safe to useBaseline: widely available
| Browser | Since |
|---|---|
| Chrome | 108+ |
| Chrome Android | 108+ |
| Edge | 108+ |
| Firefox | 101+ |
| Firefox Android | 101+ |
| Safari | 15.4+ |
| Safari iOS | 15.4+ |
Formula 1vi = 1/100 of the viewport size in the inline direction
How it works
1vi is 1% of the viewport along the inline axis, the direction text runs in. In ordinary horizontal text that axis is horizontal, so vi equals vw: 128px per 10 in a window 1280px wide. In vertical text it turns into the height.
The open question is whose writing mode decides, and the documentation does not agree with itself. MDN and the summary table in the specification point at the writing mode of the root. The definition of vi, in the editor’s draft of the specification read on 2026-11-04, says the inline axis of the box. Chromium 156 on Linux, measured with the test named “vi and vb” in tests/claims.spec.ts, takes the box’s side and uses the writing mode of the element the unit is written on, after the cascade and inheritance, whether the element sets it or inherits it. A vertical element on a horizontal page gets width: 10vi as 80px in a window 800px tall. A horizontal element inside a vertical parent gets 128px at 1280px wide. Direction plays no part: direction: rtl changes nothing. The same measurement, repeated in tests/browsers.spec.ts for all four prefixes, gave the same numbers in Firefox 157 and WebKit 27.2, so the three engines agree with each other and with the definition, not with the summary table.
Because writing-mode is inherited, the two readings give the same result wherever no element overrides the value of the root. A child of a vertical root measured 80px for width: 10vi, which is what the specification says too. They part ways when horizontal and vertical text share a document, so test that case in each browser you support before building a layout on it.
Try it
Viewport units for a window of your choice
Enter a window size, or take the one you have. Ten of each unit comes out as a tenth of the width, the height, the shorter side or the longer one.
10vw- 128px
10vh- 80px
10vmin- 80px
10vmax- 128px
On a desktop window svh, lvh and dvh give the same numbers as vh. They differ only while a phone browser shows or hides its toolbars, which this page cannot show.
The same as a table
| Unit | Laptop, 1280 by 800 | Phone, 390 by 844 |
|---|---|---|
10vw | 128px | 39px |
10vh | 80px | 84.4px |
10vmin | 80px | 39px |
10vmax | 128px | 84.4px |
What changes it
- Moves with
- the window size
- the writing mode
- Stays put under
- the reader's text size
- page zoom
- the font in use
- the query container
- phone toolbars
Reach for it when
Layouts that must work in horizontal and vertical writing modes.
Watch out
MDN and the summary table in the specification take the axis from the writing-mode of the root, while the definition of vi says the box's own. Chromium 156, Firefox 157 and WebKit 27.2, measured on this site, follow the definition: the element that carries the unit, set there or inherited. The readings agree until an element overrides writing-mode, so test that case in each browser you support. Right-to-left direction changes nothing in either reading, only a vertical writing-mode does.
.column {
inline-size: 40vi;
}