Skip to content

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.

NOTE

This page introduces a CSS module. To find an exhaustive list of all values, types, and functions defined by CSS specifications, see the values reference page.

Reference

Properties

  • interpolate-size

Functions

  • abs()
  • acos()
  • asin()
  • atan()
  • atan2()
  • attr()
  • calc()
  • calc-size()
  • clamp()
  • cos()
  • exp()
  • hypot()
  • ident()
  • if()
  • inherit()
  • log()
  • max()
  • min()
  • mod()
  • pow()
  • progress()
  • 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(), random(), random-item(), referrerpolicy(), src(), type(), and toggle() functions. Currently, no browsers support these features.

Data types

The CSS values and units module also introduces the frequency and frequency-percentage data types. Currently, no browsers support these features.

Units

Flex units (fr) and container units (cqb, cqh, cqi, cqmax, cqmin, cqw) are defined in the CSS grid layout and CSS conditional rules modules, respectively.

Unit categorizations

Key concepts

Guides

  • CSS data types

    • Introduction to CSS data types that define typical values accepted by CSS properties and functions.
  • Numeric data types

    • Overview of the numeric data types, including integers, numbers, percentages, and dimensions, along with relative and absolute dimensions, angles, and time units.
  • Textual data types

    • Overview of the textual data types, including pre-defined keyword values, global CSS keyword values, and URLs.
  • CSS value functions

    • Overview of the CSS statements that invoke special data processing or calculations to return a CSS value for a CSS property.
  • Using CSS math functions

    • The CSS math functions that allow a property value to be written as a mathematical expression.
  • Value definition syntax

    • The formal grammar used to define the set of valid values for CSS properties and functions.
  • Using CSS typed arithmetic

    • An explanation of CSS typed arithmetic behavior and use cases enabled by it.
  • Learn: Values and units

    • A look at some of the most frequently used value types, what they are, and how they work.
  • CSS value serialization

    • How CSSOM APIs serialize color and other values into standardized string representations.

Specifications

See also