CSS unit cheatsheet
One line per unit: what it equals and whether you can rely on it. Print it, or keep it open next to your editor.
CSS Unit Rulebook, units.bereg.dev/cheatsheet/
Baseline marks
Each mark is a symbol and a word, so the sheet still reads in black and white.
- Safe to use
- In every main browser for 30 months or more
- Use with a fallback
- In every main browser, for less than 30 months
- Limited support
- Missing in at least one main browser
- Not usable
- No property accepts it in any main browser
Absolute 7 units
Reference The CSS pixel
Font-relative 12 units
Reference Font size and glyph metrics
em1em = the font-size of the element; in font-size itself, the parent'sSafe to userem1rem = font-size of :root (16px unless the reader changed the browser default)Safe to usech1ch = advance width of "0" in the element's font (0.5em if it cannot be measured)Safe to userch1rch = the value of ch on the root elementUse with a fallbackex1ex = x-height of the element's font (0.5em if it cannot be determined, as the specification has it)Safe to userex1rex = the value of ex on the root elementUse with a fallbackcap1cap = cap height of the element's font (the ascent of the font if it cannot be determined, as the specification has it)Safe to usercap1rcap = the value of cap on the root elementUse with a fallbackic1ic = advance of 水 (U+6C34) in the element's font (1em if it cannot be measured)Safe to useric1ric = the value of ic on the root elementUse with a fallbacklh1lh = used line-height of the elementSafe to userlh1rlh = used line-height of :rootSafe to use
Percentage 1 unit
Reference Another value
%N% = N/100 × the reference value of the propertySafe to use
Viewport 24 units
Reference The viewport
vw1vw = 1/100 of the viewport widthSafe to usevh1vh = 1/100 of the viewport height (the large viewport)Safe to usevi1vi = 1/100 of the viewport size in the inline directionSafe to usevb1vb = 1/100 of the viewport size in the block directionSafe to usevmin1vmin = 1% of min(viewport width, viewport height)Safe to usevmax1vmax = 1% of max(viewport width, viewport height)Safe to usesvw1svw = 1/100 of the width when browser toolbars are fully shownSafe to usesvh1svh = 1/100 of the height when browser toolbars are expandedSafe to usesvi1svi = 1/100 of the small viewport in the inline directionSafe to usesvb1svb = 1/100 of the small viewport in the block directionSafe to usesvmin1svmin = 1% of min(svw, svh)Safe to usesvmax1svmax = 1% of max(svw, svh)Safe to uselvw1lvw = 1/100 of the width when browser toolbars are retractedSafe to uselvh1lvh = 1/100 of the height when browser toolbars are retractedSafe to uselvi1lvi = 1/100 of the large viewport in the inline directionSafe to uselvb1lvb = 1/100 of the large viewport in the block directionSafe to uselvmin1lvmin = 1% of min(lvw, lvh)Safe to uselvmax1lvmax = 1% of max(lvw, lvh)Safe to usedvw1dvw = 1/100 of the current visible widthSafe to usedvh1dvh = 1/100 of the currently visible heightSafe to usedvi1dvi = 1/100 of the current viewport in the inline directionSafe to usedvb1dvb = 1/100 of the current viewport in the block directionSafe to usedvmin1dvmin = 1% of min(dvw, dvh)Safe to usedvmax1dvmax = 1% of max(dvw, dvh)Safe to use
Container 6 units
Reference The nearest query container
cqw1cqw = 1/100 of the nearest container's widthSafe to usecqh1cqh = 1/100 of the nearest container's heightSafe to usecqi1cqi = 1/100 of the nearest container's inline sizeSafe to usecqb1cqb = 1/100 of the nearest container's block sizeSafe to usecqmin1cqmin = min(1cqi, 1cqb)Safe to usecqmax1cqmax = max(1cqi, 1cqb)Safe to use
Flexible 1 unit
Reference Free space in a grid
fr1fr = one part of the space left after fixed tracks and gapsSafe to use
Special 12 units
Reference Its own type
deg360deg = 400grad = 2π rad = 1turnSafe to usegrad400grad = 360deg = 1turnSafe to userad2π rad = 360deg = 1turnSafe to useturn1turn = 360deg = 400grad = 2π radSafe to uses1s = 1000msSafe to usems1ms = 0.001sSafe to useHz1Hz = 1 cycle per secondNot usablekHz1kHz = 1000HzNot usabledpi1dpi = 1/96dppxSafe to usedpcm1dpcm = 2.54dpiSafe to usedppx1dppx = 96dpi = 1xSafe to usex1x = 1dppx = 96dpiSafe to use
Support data: MDN browser-compat-data 8.1.7, checked 2026-11-01