Every CSS declaration consists of a property/value pair. The value can take various forms depending on the property, such as a single integer, keyword, function, or a combination of different items; some values have units, while others do not. Every property also accepts the CSS-wide values. The CSS values and units module defines the data types — values and units — that CSS properties accept. This module also defines the CSS value definition syntax, or formal grammar, used to define the set of valid values for every CSS property and function.
abs()acos()asin()atan()atan2()attr()calc()calc-size()clamp()cos()exp()hypot()<ident()>if()inherit()log()max()min()mod()pow()rem()round()sibling-count()sibling-index()sign()sin()sqrt()tan()url()The CSS values and units module also introduces the calc-mix(), crossorigin(), first-valid(), integrity(), progress(), random(), random-item(), referrerpolicy(), src(), type(), and toggle() functions. Currently, no browsers support these features.
<angle-percentage><angle><animation-timeline><attr-name><attr-type><calc-keyword> (e, pi, infinity, NaN)<calc-size-basis><calc-sum><custom-ident><dashed-ident><dimension><easing-function><first-valid()><ident><integer><length-percentage><length><number><percentage><position><ratio><resolution><rounding-strategy> (down, up, to-zero)<string><syntax><time-percentage><time><url><url-modifier><view-timeline-name>The CSS values and units module also introduces the <frequency> and <frequency-percentage> data types. Currently, no browsers support these features.
% (percentage)capchcmdegdpcmdpidppxdvbdvhdvidvmaxdvmindvwemexgradHzicinkHzlhlvblvhlvilvmaxlvminlvwmmmspcptpxQradrcaprchremrexricrlhssvbsvhsvisvmaxsvminsvwturnvbvhvivmaxvminvwxFlex units (fr) and container units (cqb, cqh, cqi, cqmax, cqmin, cqw) are defined in the CSS grid layout and CSS conditional rules modules, respectively.
cm, in, mm, pc, pt, px, Q)deg, grad, rad, turn)vb , vh, vi , vmax, vmin, vw)dvb, dvh, dvi, dvmax, dvmin, dvw)Hz, kHz)lvb, lvh, lvi, lvmax, lvmin, lvw)cap, ch, em, ex, ic, lh)cm, in, mm, pc, pt, Q)cap, ch, em, ex, ic, lh, rem, rlh, vb, vh, vi, vmax, vmin, vw)dpcm, dpi , dppx, x)rcap, rch, rem, rex, ric, rlh)svb, svh, svi, svmax, svmin, svw)ms, s)dvh, dvw, lvh, lvw, svh, svw, vb , vh, vi , vmax, vmin, vw)px)Introduction to CSS data types that define typical values accepted by CSS properties and functions.
Overview of the numeric data types, including integers, numbers, percentages, and dimensions, along with relative and absolute dimensions, angles, and time units.
Overview of the textual data types, including pre-defined keyword values, global CSS keyword values, and URLs.
Overview of the CSS statements that invoke special data processing or calculations to return a CSS value for a CSS property.
The CSS math functions that allow a property value to be written as a mathematical expression.
The formal grammar used to define the set of valid values for CSS properties and functions.
A look at some of the most frequently used value types, what they are, and how they work.
CSS grid layout module
<flex>fr)CSS conditional rules module
cqb, cqh, cqi, cqmax, cqmin, cqw)CSS colors module
CSS images module
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Values_and_Units