Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

dvmax — the larger dynamic viewport dimension

The dvmax length unit equals 1% of the larger dynamic viewport dimension: its width or height.

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

Syntax

<number>dvmax

dvmax is a CSS length unit: 1dvmax = max(1dvw, 1dvh). A number immediately precedes the unit, for example 10dvmax. It is not based on the parent element’s size.

The dynamic viewport accounts for expanding and retracting browser UI. Values can change during scrolling; smooth updates during UI animation are not guaranteed.

dvmin selects the smaller dimension. svmax and lvmax refer to the small and large viewports respectively; vmax equals lvmax.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>dvmax demo</title>
<style>
  html { overflow: hidden; }
  body { margin: 0; }
  .square {
    width: 10dvmax;
    height: 10dvmax;
    background: teal;
  }
</style>
<div class="square"></div>
</html>

Result

Dynamic viewport 800 × 600 CSS px: a teal square measuring 80 × 80 CSS px. Dynamic viewport 600 × 900 CSS px: 90 × 90 CSS px.

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