dvh — dynamic viewport height
The dvh unit equals 1% of the dynamic viewport height, accounting for browser interface elements that expand and retract.
CKTIS / Knowledge base
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
The dvh unit equals 1% of the dynamic viewport height, accounting for browser interface elements that expand and retract.
The dvmax length unit equals 1% of the larger dynamic viewport dimension: its width or height.
The dvmin length unit represents 1% of the smaller dynamic viewport dimension. It accounts for browser interfaces expanding and retracting.
The dvw unit equals 1% of the dynamic viewport width. It sizes lengths against space that accounts for browser interfaces that expand and retract.
The em unit expresses a length relative to computed font-size. In font-size it uses the parent's size; in properties such as padding it uses the element's own size.
The ex length unit refers to the x-height of the first available font. It lets dimensions follow font metrics, but does not represent a fixed pixel count or always equal half an em.
The fr unit distributes leftover space among CSS Grid tracks, subject to flex factors and sizing constraints.
The `grad` unit expresses angles in gradians: a full turn is `400grad`, and a right angle is `100grad`. Use it wherever CSS syntax accepts an `<angle>`.
The ic unit measures lengths using the metrics of the 水 glyph in the font used to render it. It is useful for dimensions based on CJK characters.
The `in` unit represents a CSS inch: `1in = 96px = 2.54cm`. It is an absolute length unit, but it does not guarantee a physical one-inch measurement on a screen.
The lh unit ties lengths to an element’s line-height. It aligns spacing with the text rhythm but does not measure actual rendered lines.
The lvh unit represents 1% of the large viewport height, determined assuming retractable browser interface elements are hidden.
The lvmax unit is 1% of the larger dimension of the large viewport, calculated assuming retractable browser interfaces are retracted.
The lvmin unit represents 1% of the large viewport’s smaller dimension, calculated with retractable browser interface elements assumed hidden.
The lvw unit represents 1% of the large viewport width: the size calculated with dynamically retractable browser interface elements assumed to be retracted.
The mm unit represents an absolute CSS length: 25.4mm equals 96px, but does not guarantee physical millimeters on screen.
The `ms` unit represents time in CSS. One millisecond is one thousandth of a second: `250ms` and `0.25s` represent the same duration. Use it in properties that accept values of type `<time>`.
The CSS pc unit represents picas, an absolute length unit: 1pc = 12pt = 16px. It has fixed ratios to other absolute units but does not guarantee a real-world physical size on a screen.
The pt unit represents a CSS point: 1/72 of a CSS inch. Its conversion to px is fixed and independent of font size.
px is an absolute CSS length unit. Its relationship to other absolute units is fixed: 96px = 1in. A CSS pixel does not necessarily correspond to one physical screen pixel.
Q is an absolute CSS length unit: 1Q = 0.25mm. It has a fixed conversion to px but does not guarantee an actual physical measurement on a screen.
The `rad` unit expresses CSS angles in radians. A full turn is 2π radians; values using this unit belong to the `<angle>` type.
The rcap unit expresses a length relative to the root element’s font cap height. On a descendant, unlike cap, it does not depend on that descendant’s font size. On the root itself, changing its font size can change a width expressed in rcap.
The rch length unit equals ch on the document’s root element. It sizes elements using root font metrics rather than the local font size.