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 IdentifierDescription
inInches
cmCentimeters
mmMillimeters
ptPoints (1 point is 1/72 of an inch)
pcPicas (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>

Click to view the demo





















Home »
  HTML CSS »
    CSS »




CSS Introduction
CSS Background
CSS Border
CSS Box Layout
CSS Text
CSS Font
CSS Form
CSS List
CSS Selectors
CSS Others
CSS Table