Using Points

From CSS Discuss

Jump to: navigation, search

On Using Points

Part of: Using Font Size

Many beginning CSS authors use points to size text, in part because many of them come from a desktop publishing background, where everything is set in points. However, points are a very bad unit for screen-based design-- that is, for Web pages that are meant to be viewed in a monitor. Todd Fahrner provides a graphic example of why this is the case in his GIF essay Why Points Suck. It dates from the early days of CSS on the Web, but it's still highly relevant.

The basic problem is that a point is a physical-world unit of measure, corresponding to one-seventy-second of an inch (thus 12 points to a pica, and 6 picas to an inch). In order to correctly size text using points, the browser has to know how many pixels there are to an inch. Unfortunately, most computers don't know, so the browsers don't either. With the various monitor sizes, resolutions, and so on, any ratio of pixels-to-inches is possible.

In the absence of this knowledge, operating systems and browsers typically just make assumptions, and these assumptions are usually wrong. In the Macintosh operating system (up through OS9, and maybe further), the assumption is that there are 72ppi (pixels per inch), so one point equals one pixel. Most Windows systems usually assume either 96ppi or 120ppi, which result in pixel-to-point ratios of 1.333:1 and 1.667:1, respectively. So by writing something like {{h1 {font-size: 24pt;}}}, for example, your text will be 24 pixels tall on Macs, 32 pixels tall on some Windows machines, and 40 pixels tall on other Windows machines.

So when it comes to screen design, points should be strenuously avoided. However, for print design, points make perfect sense. Printing devices almost always know the size of the printing area, and thus can correspond points to inches without any problem. So if you're writing a print-media stylesheet, points are a fine choice for text sizing. Just keep them away from the screen-media styles, and you'll be fine.

[A note of dissent on this last point]

It's true that, for printed pages, you can probably guarantee the absolute size of the text (i.e. in centimetres or inches) if you use points.It isn't desirable from an accessibility viewpoint. If it was, then there would be no market for large-print books for vision-impaired people. Therefore, I think that relative units (such as em) and are as desirable for print stylesheets as they are for stylesheets for screen (or for any other medium). Jim Wilkinson

See Also

Personal tools