Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

vb — viewport block-axis unit

The vb unit represents 1% of the large viewport along the element’s block axis. That axis depends on writing-mode.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

<number>vb

vb is a length unit: 1vb is 1% of the large viewport’s dimension along the element’s block axis, not its parent’s. Write the number directly before the unit: 25vb.

With writing-mode: horizontal-tb, it corresponds to height; with vertical-rl, to width. Unlike vh, it is not tied to the vertical axis; vi concerns the inline axis.

vb corresponds to lvb. svb uses the small viewport, while dvb uses the dynamic viewport. Expanded browser controls can obscure content sized using vb.

Examples

<!doctype html>
<meta charset="utf-8">
<title>vb example</title>
<style>
  html { overflow: hidden; }
  body { margin: 0; }
  .box {
    writing-mode: horizontal-tb;
    block-size: 25vb;
    inline-size: 100px;
    background: teal;
  }
</style>
<div class="box"></div>

Result

For a large viewport of 800 × 600 CSS px: a teal rectangle 100 CSS px wide and 150 CSS px high.

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources