Length units can be expressed with positive or negative numbers and with integers and real numbers (numbers with a decimal part). Not all properties accept negative numbers, nor do all properties accept decimals. Unless the number is 0 (zero) it will be followed by a two character abbreviation for a unit. Units come in absolute and relative.
Points and picas originally referred to the height of letters for typesetters.
While these are good terms for use with printers, when used with a monitor there are some problems. Monitors measure horizontal and vertical space in pixels. The smallest unit on a screen is 1 pixel, the smallest unit for type is 1 point. It is exceedingly rare to find a screen in which 1 pixel = 1 point (i.e. 1/72 inch). Most screens have more than 72 pixels per inch.
The standard Windows resolutions use 96 pixels per inch. However Windows can be adjusted so that what the operating system uses matches the reality of the monitor. The Macintosh operating system assumes the monitor has 72 pixels per inch, which is usually completely wrong. On a Macintosh 12 point type will be 12 pixels high, regardless of the resolution of the monitor, which usually leads to characters being incorrectly sized on a Macintosh if points are used to describe text sizes.
| Measure | Sample |
| Default | text sample |
| 12 point | text sample |
| 6 pica | text sample |
| 12 millimeters | text sample |
| 0.5 centimeters | text sample |
| 0.25 inches | text sample |
| Default | text sample |
Some browsers allow the user to set the onscreen resolution instead of working with the operating system's assumed value. Unfortunately this is not common knowledge and does not apply with all browsers.
The physical measures, inches, centimeters, millimeters, will normally be followed properly. Even so, absolute length units are much better used for printed documents than for on screen documents.
| Measure | Sample |
| Default | text sample |
| 1 em | text sample |
| 4 ex | text sample |
| 20 pixels | text sample |
Using pixels as units causes problems for people using Internet Explorer (80% - 90% of WWW users). If sizes are set using pixels the viewer cannot change their size. This is a significant problem for those who want or require larger type in order to read your information. Graphical elements (pictures, borders, lines) normally use pixels for sizing.
em is probably the safest unit to use for items that should change in size as screen sizes (browser window sizes) change. The absolute units in, cm and mm are very useful when objects need to be a fixed size (margins or columns for example). ex is a fraction of em and is unnecessary at the moment. Points and picas vary in size from one operating system to another and do not generate the same size of text from one screen to another. If you are prepared to live with this variance, or design with it, they are a reasonable alternative to em. px is most useful with graphic elements and may or may not be effective with text.