Prev | Current Page 87 | Next

Charles Wyke-Smith

"Stylin' with CSS: A Designer's Guide 2nd Edition"


There??™s not much I can tell you about word values that would
make sense until you start using them, because they are speci?¬? c to
each element. Numerical and color values, however, can only be
expressed in certain ways.
Numerical Values
You use numerical values to describe the length (and I use ???length???
generically to mean height, width, thickness, and so on) of all kinds
of elements. These values fall into two main groups: absolute and
relative.
HOW CSS WORKS 61
Absolute values (Table 2.2) describe a length in the real world (for
example, 6 inches), as compared to a relative measurement, which
is simply a relationship with some other measurable thing (when
you say ???twice as long??? that??™s a measure relative to something else).
TABLE 2.2 Absolute Values
ABSOLUTE VALUE UNIT ABBREVIATION EXAMPLE
Inches in height:6in
Centimeters cm height:40cm
Millimeters mm height:500mm
Points pt height:60pt
Picas pc height:90pc
Pixels px height:72px
*Examples are not equivalent lengths.
When writing CSS that relates to ?¬? xed-sized elements such as
images, I use only pixels. It??™s up to you, but pixels are also the only
absolute unit that I use throughout this book, except in print style
sheets??”because paper is measured in inches, it makes sense to
design print layouts with the same units.
Although the absolute units are pretty self-explanatory, the relative
units (Table 2.


Pages:
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99