CHAPTER 9

image

Units

There are several units to choose from when specifying the size of a property’s value.

Absolute units

The absolute units of length are centimeter (cm), millimeter (mm), and inch (in). Although these units are meant to look the same regardless of the screen resolution, it is not always the case because web browsers do not always know the exact physical size of the display medium.

.one-cm { font-size: 1cm; }.one-mm { font-size: 1mm; }.one-in { font-size: 1in; }

These units are mainly useful when the size of the output medium is known, such as for content that will be printed to paper. They are not recommended for screen displays ...

Get CSS Quick Syntax Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.