Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

mm — CSS millimeter

The mm unit represents an absolute CSS length: 25.4mm equals 96px, but does not guarantee physical millimeters on screen.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

<number>mm

mm is the millimeter unit of the <length> type. Write it immediately after a number, without whitespace: width: 25.4mm. Use it wherever a property accepts a length; whether negative values are allowed depends on the property.

The ratios are fixed: 10mm = 1cm and 25.4mm = 1in = 96px. Unlike em or viewport units, mm does not depend on font size or viewport size.

On screen, the physical size can differ from millimeters. Physical units are useful for print, but print scaling can change the result. The example checks dimensions in CSS pixels, not measurements with a ruler.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>CSS mm</title>
<style>
  .sample {
    width: 25.4mm;
    height: 10mm;
    background: navy;
  }
</style>
<div class="sample"></div>
</html>

Result

In Chromium, the navy rectangle has a layout width of 96 CSS px and a layout height of 37.78125 CSS px.

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources