This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

CSS data types

Summary

CSS defines different data types which can the be specified as the allowed values for CSS properties or media feature tests.

See the following pages for information about the syntax and possible units for each data type:

  • <string> values specify literal strings.
  • <custom-ident> values are identifiers created by the page author to reference the same content in multiple CSS rules.
  • Keywords are identifiers defined in the CSS specifications to have a particular meaning.
  • <color> values can use different systems to specify colors, with optional opacity values.
  • <image> values use various ways of specifying or defining graphical content.
  • <url> values reference files or file fragments.
  • <number> values specify integers or decimals.
  • <integer> values specify integers.
  • <percentage> values specify percentages.
  • <length> values specify distances and coordinates in either absolute or relative terms.
  • <position> values specify horizontal and vertical position of an element with a mix of keywords, lengths, and percentages.
  • <angle> values specify degrees of rotation.
  • <resolution> values specify display or print dot density, typically within CSS media queries
  • <time> values specify duration, typically for animations.
  • <frequency> values specify sound pitches. (Not currently applicable to any CSS property.)