CSS Values & Types

What You’ll Learn
Data types describe what kinds of values a property can accept. Learn lengths, colors, angles, times, and combinations used across CSS.
Type Index
Numeric & Quantities
Numbers, lengths, angles, times, and related units.
<length>TutorialDistances such as px, rem, em, vw, and lh.
<percentage>TutorialValues relative to another size, written with %.
<number>TutorialUnitless real numbers used in ratios and scales.
<integer>TutorialWhole numbers for z-index, columns, and counters.
<angle>TutorialAngles with deg, rad, grad, or turn units.
<time>TutorialDurations with s or ms units.
<frequency>TutorialFrequencies with Hz or kHz units.
<resolution>TutorialPixel density units such as dpi and dppx.
<ratio>TutorialWidth-to-height ratios like 16/9.
<flex>TutorialFlexible lengths with the fr unit in Grid.
<alpha-value>TutorialTransparency as a number or percentage.
<length-percentage>TutorialAccepts either a length or a percentage.
Color, Image & Position
Visual value types used in painting and placement.
<color>TutorialKeywords, hex, and color functions.
<image>TutorialURLs and gradients used as images.
<position>TutorialKeywords and offsets for object placement.
Textual Types
Strings, URLs, and identifiers including custom properties.
<string>TutorialQuoted text values for content and quotes.
<url>TutorialResource pointers via url().
<ident>TutorialCSS identifiers such as animation names.
<custom-ident>TutorialAuthor-defined identifiers.
<dashed-ident>TutorialIdentifiers that start with -- for custom properties.
More
Additional reference topics.
<absolute-size>TutorialCSS type <absolute-size>
<angle-percentage>TutorialCSS type <angle-percentage>
<basic-shape>TutorialCSS type <basic-shape>
<blend-mode>TutorialCSS type <blend-mode>
<box-edge>TutorialCSS type <box-edge>
<calc-keyword>TutorialCSS type <calc-keyword>
<calc-product>TutorialCSS type <calc-product>
<calc-sum>TutorialCSS type <calc-sum>
<calc-value>TutorialCSS type <calc-value>
<color-interpolation-method>TutorialCSS type <color-interpolation-method>
<coord-box>TutorialCSS type <coord-box>
<dimension>TutorialCSS type <dimension>
<display-box>TutorialCSS type <display-box>
<display-inside>TutorialCSS type <display-inside>
<display-outside>TutorialCSS type <display-outside>
<easing-function>TutorialCSS type <easing-function>
<filter-function>TutorialCSS type <filter-function>
<frequency-percentage>TutorialCSS type <frequency-percentage>
<generic-family>TutorialCSS type <generic-family>
<gradient>TutorialCSS type <gradient>
<hue>TutorialCSS type <hue>
<overflow>TutorialCSS type <overflow>
<relative-color>TutorialCSS type <relative-color>
<relative-size>TutorialCSS type <relative-size>
<time-percentage>TutorialCSS type <time-percentage>
<timeline-range>TutorialCSS type <timeline-range>
<transform-function>TutorialCSS type <transform-function>
!importantTutorialCSS type !important
inheritTutorialCSS type inherit
initialTutorialCSS type initial
revertTutorialCSS type revert
revert-layerTutorialCSS type revert-layer
unsetTutorialCSS type unset
fit-contentTutorialCSS type fit-content
max-contentTutorialCSS type max-content
min-contentTutorialCSS type min-content
revert-ruleTutorialCSS type revert-rule
<corner-shape-value>TutorialCSS type <corner-shape-value>
<color-stop>TutorialCSS type <color-stop>
<linear-color-stop>TutorialCSS type <linear-color-stop>
<radial-color-stop>TutorialCSS type <radial-color-stop>
<ending-shape>TutorialCSS type <ending-shape>
<fr>TutorialCSS type <fr>
Frequently Asked Questions
Next: CSS <length> Data Type
Start with the first tutorial in this section.
CODETOFUN NEWS
Stay Ahead in Tech
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
6 people found this page helpful
