Prev | Current Page 115 | Next

Charles Wyke-Smith

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

13.
FIGURE 3.13 Bolded, italicized,
small-capped, sized, and font-family
speci?¬? ed??”all in a single CSS rule.
The font property is a nifty shortcut that lets you apply all of the
font properties in a single declaration, which helps reduce the
amount of CSS you have to write to achieve your desired font styling.
You have to sequence the values in the correct order, however,
so that the browser can interpret them correctly.
Two simple rules apply:
Rule 1: Values for font-size and font-family must always be
declared.
Rule 2: The sequence for the values is as follows:
1. font-weight, font-style, font-variant, in any order, then
2. font-size, then
3. font-family
Text Properties
So now that you??™ve looked at how to get the font you want, it??™s time
to look at how to style text. If you want to indent a paragraph, create
a superscript such as the 6 in 106, create more space between each
letter of a headline, and many other type formatting tasks, you need
to use the CSS text properties.
Jumping ahead somewhat, you can
write the font-size property to
also include the line-height property
(which is a text property rather
than a font property) by writing the
size as 12px/150% or similar, which
in print parlance results in 12 pixel
text with 18 pixel leading. Line height
is to CSS what leading is to typesetting
in the world of print.


Pages:
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127