Absolute · Chapter 1 of 7 · 7 units
Absolute Units
On screens, an inch is a gentleman’s agreement.
Absolute units look simple: fixed sizes, no context needed. But they hide one important nuance. On screens, they don’t always match their physical counterparts. The whole system is anchored to a single equation:
1in = 96px
Every other absolute unit is defined relative to this anchor. So 1in, 2.54cm, 25.4mm, 72pt and 6pc all compute to exactly 96px on a screen, regardless of your monitor’s physical size.
1in96px1cm1pc1mm1pt1Q1in and 96px are the same width — on screens, all absolute units resolve to CSS pixels via 1in = 96px.—px
The CSS pixel is the foundation of screen interfaces, but it is not a physical dot on your display.
CSS defines a reference pixel as the visual angle of one pixel on a 96 dpi device viewed from a distance of 28 inches (roughly arm’s length).That 28-inch arm is a real anthropometric estimate written into the spec: the pixel is defined as a unit of seeing, not of hardware. A useful mental model is that 96px behaves like one “logical inch”, but a logical inch is not a real-world inch: on most screens 96px won’t match a ruler (see the in section below).
On a standard 1× display, 1 CSS px = 1 device pixel. On a HiDPI display (Retina MacBook, iPhone, high-end Android) the ratio is 2 or more per axis: at 2×, a 1×1 px square is painted with two device pixels across and two down — four in total.Worth stating plainly, because “a CSS pixel is two device pixels” is the usual shorthand and it undercounts the area by half. The ratio is linear; the pixels are a grid.
That ratio is window.devicePixelRatio, and it is not a property of the screen alone. The spec defines it as the size of a CSS pixel at the current page zoom divided by the size of a device pixel — so zooming the page changes it on hardware that has not moved. Read it as “device pixels per CSS pixel right now”, not as “what kind of display is this”.
1px—≈ Physical pixels —- Borders:
border: 1px solid - Icon sizes:
width: 24px; height: 24px - Precise details: outlines, shadows, hairlines
- Values that must stay constant in CSS coordinates
font-sizefor body text — it ignores the user's default-font-size setting (userem)- Layout widths that should be fluid —
%,rem, orfradapt; a fixedpxwidth doesn't - Sizes that should follow the user's default font size
in
The CSS inch. On screens, 1in is exactly 96px, which may or may not be a real inch on your physical monitor.
Hold a ruler to your screen and measure a 1in element. On most monitors, it won’t match. The CSS inch is calibrated for the reference pixel model, not your device’s physical dimensions.
The bar above is exactly 1in wide in CSS. Hold a real ruler against it: on most screens the two won't agree, because on screen this unit resolves through 1in = 96px rather than through your display's physical size.
- Print stylesheets:
@media print - PDF generation and physical-output layouts
- As an anchor for understanding the unit system
- Screen UI — write
96pxinstead for clarity - Matching physical specs on screen (it won't be accurate)
cm
The CSS centimeter. Since 1in = 2.54cm, one CSS centimeter equals ≈ 37.795px. Like in, it maps to a real centimeter only in print contexts.
That print context is where cm earns its keep: @page { margin: 2cm } reads exactly like the paper document it produces, and anyone who has ever set margins in a word processor can review it without converting anything.
The bar above is exactly 5cm wide in CSS. Hold a real ruler against it: on most screens the two won't agree, because on screen this unit resolves through 1in = 96px rather than through your display's physical size.
- Print layouts with metric measurements
- Physical templates and packaging specs
- Screen UI — on screen
1cmis just≈ 37.8pxwith extra indirection - Grid systems or component sizing
mm
One tenth of a CSS centimeter, or ≈ 3.78px. Small enough to be useful for margins, gutters, and bleed areas in print layouts.
This is the unit the physical world is specced in: a European business card is 85mm × 55mm, a typical print bleed is 3mm. Write those numbers as they appear on the spec sheet and the CSS documents itself.
The bar above is exactly 20mm wide in CSS. Hold a real ruler against it: on most screens the two won't agree, because on screen this unit resolves through 1in = 96px rather than through your display's physical size.
- Precise print measurements: business cards, labels, forms
- Physical packaging templates
- Screen interfaces — not a meaningful grid unit at ~3.78px
- Component sizing
Q
A quarter-millimeter — the smallest absolute unit in CSS. At 0.945px, it sits below one CSS pixel, so rendering depends on sub-pixel anti-aliasing and varies across browsers.
The Q unit originates from Japanese print typography, where the kyu (Q) is a traditional typesetting unit.級 (kyū) means “grade”; one kyū is exactly 0.25mm. The romanization made Q the only CSS length written with a capital letter — and the only one named in Japanese. It landed in the CSS spec to serve Japanese print workflows. It was the last absolute unit to become universal: Firefox shipped it in 2016, Chrome in 2017, and Safari only in 13.1 (March 2020). Internet Explorer never supported it, which matters only for archived stylesheets now.
1Q≈ 0.945px1px1px2Q≈ 1.89px4Q≈ 3.78px1mm≈ 3.78px (= 4Q)1Q1px4Q- Specialized CJK or Japanese print typography
- Typographic systems requiring quarter-millimeter precision
- Screen UI — at
≈ 0.945pxit renders sub-pixel, so results vary by browser - Any context where sub-pixel rendering consistency matters
pt
The typographic point: the traditional unit of print typography, inherited from physical typesetting. There are 72 points per inch, so 1pt ≈ 1.333px in CSS.
Points are familiar from print design tools: InDesign, Illustrator and Word all size type in pt. (Figma is the exception people expect to see here — it sizes text in pixels, and only converts to points on PDF export.) 12pt body text and 24pt headings are deeply ingrained print conventions.
12ptThe quick brown fox jumps over the lazy dog.
16pxIn rem 1rem- Print stylesheets and PDF generation
- Documents where the spec is defined in points
- Matching a print design spec exactly
- Web typography —
12pt = 16pxbut won't scale with user prefs - Pasting point values directly from Figma into browser CSS
pc
The pica, equal to 12 points. 1pc = 16px, which happens to equal the browser’s default body font size: a coincidence worth knowing.
Picas were used to measure columns, gutters, and large typographic elements in traditional print. In web CSS, they appear almost exclusively in print stylesheets or code from developers with a print background.
1pc = 12pt = 16px1pc16px12pt16px16px16pxAll three bars are identical widths. 1pc = 12pt = 16px — and that 16pxalso happens to be the browser default body font size.
- Print layouts using a pica-based grid system
- Documents that specify column widths in picas
- General web layout —
1pcis a fixed16px, so it carries the same trade-offs aspx - In code that mixes units —
pcis easy to misread aspx(it's16px, not1px)
Conversion reference
All absolute units mapped to CSS pixels:
| Unit | Definition | CSS pixels |
|---|---|---|
1px |
1in / 96 |
1 px |
1pt |
1in / 72 |
≈ 1.333 px |
1Q |
1mm / 4 |
≈ 0.945 px |
1mm |
1cm / 10 |
≈ 3.78 px |
1pc |
12pt |
16 px |
1cm |
96px / 2.54 |
≈ 37.795 px |
1in |
— anchor — | 96 px |
When to reach for absolute units
In modern web development, absolute units have a narrow role:
px— the workhorse. Borders, shadows, icon sizes, anything that should stay constant regardless of font size or viewport.pt,cm,mm,in,pc,Q— mainly@media printand physical-output contexts. On screens they all resolve through the1in = 96pxanchor, so they’re pixel values with extra steps.- Accessibility: here’s the precise distinction. Page zoom does scale
pxtext (the whole page magnifies). Whatpxignores is the user’s default-font-size setting: someone who sets their browser default to 20px still sees yourfont-size: 16pxas 16px.rem/emhonor that preference, which is why they’re the safer default for type.
Sources
- CSS Values and Units Module Level 4 — absolute lengths
- CSS Values and Units Module Level 4 — reference pixel
- MDN — CSS length values
- CSSOM View —
window.devicePixelRatio— the algorithm that makes it follow page zoom - Smashing Magazine — There is no such thing as a CSS absolute unit — the same argument, at length