useful, in practice, most designers still use points or pixels when specifying
type size. Perhaps it’s just force of habit, but in any case the results usually
look fine in most browsers.
Measuring length ...............................................................................
Before I get to an explanation of just what em actually means, I first want to
take a look at all the units that measure length:
px (pixels):Pixels are the smallest unit on a display — the dots you can
sometimes see if you get close enough to a TV. For example, setting your
monitor resolution to 800x600 means that it is 800 pixels wide by 600
pixels high.
Pixels can be a useful way to specify font size, but the drawback is that
if you specify pixels, that overrides the custom font size option in
Internet Explorer — so users cannot adjust from “large” to “largest”
and so on. However, you should always use pxto describe imagesizes.
Images are already measurable in pixels (you can see the measurements
by loading the image into any graphics application).
pt (points): A point is equal to 1/72 inch. Points (and picas) are classic
typeface measurements. Most browsers default to a 12-point serif
typeface.
pc (picas):One pica equals 12 points.
mm (millimeters):A millimeter is .0394 inches, so one inch contains
roughly 26 millimeters. One centimeter contains 10 millimeters. Much of
the world uses this metricsystem.
cm (centimeters): A centimeter is .3937 inches, so an inch contains
roughly 2 1/2 centimeters.
in (inches):Inches are a unit in the Englishor imperial system — used
in the United States. England and a few remnants of the colonial period
also stayed with the imperial system for a long time, but caved recently.
The British government complied in 2000 with European metrication
and it is now a criminal offense to sell by the pound anywhere in Her
Majesty’s realm. A man in Cornwall, for example, reportedly had to pay
court costs after being caught selling mackerel at £1.50 a pound.
An inch is based on the distance between the first knuckle and the end
of a now-forgotten king’s thumb. For 50 years, persistent efforts to edu-
cate and legislate away the imperial system in favor of the metric have
failed in the U.S.
em:Em is a unit of measurement derived from the approximate width of
the letter mof a font. This is considered generally the best way to spec-
ify font size in CSS, although few designers follow this advice.
108 Part II: Looking Good with CSS