Absolute Lengths
Description
The cm
and pt
units,
both of which are examples of absolute units.
These units are real-world measurements. CSS supports five types of absolute units.
Unit Identifier | Description |
---|---|
in | Inches |
cm | Centimeters |
mm | Millimeters |
pt | Points (1 point is 1/72 of an inch) |
pc | Picas (1 pica is 12 points) |
You can mix and match units in a style and also mix absolute and relative units.
Example
You can mix and match units.
<!DOCTYPE HTML>
<html>
<head>
<style>
p { <!--from w w w. j av a2 s. c om-->
width: 5cm;
font-size: 20pt;
}
</style>
</head>
<body>
<p>I like <span>HTML</span> and CSS. java2s.com</p>
</body>
</html>