This should cause few problems with text, but some designers
insist on rendering text with very little contrast to the background color, and this ends up
being even harder to read on a different platform from the one on which it was created.
Defining fonts
The font-family property enables you to specify a list of font face values, starting with
your preferred first choice, continuing with alternates (in case your choice isn??™t installed
on the user??™s machine), and terminating in a generic font family, which causes the browser
to substitute a similar font (think of it as a last resort).
selector {
font-family: preferred, alterate 1, alterate 2, generic;
}
The most common generic font family names are serif and sans-serif, although when
you??™re using monospace fonts (such as Courier New), you should end your list with
monospace.
Multiple-word font family names must be quoted (such as "Trebuchet MS" and "Times
New Roman"). You can use single or double quotes??”just be consistent. Single-word font
family names should never be quoted. Examples of font-family in use are as follows:
h1 {
font-family: Arial, Helvetica, sans-serif;
}
p {
font-family: Georgia, "Times New Roman", Times, serif;
}
pre {
font-family: Courier, "Courier New", Monaco, monospace;
}
The main tip to keep in mind for color with regard to web-based text is simple: always
provide plenty of contrast so that your text remains readable.
THE ESSENTIAL GUIDE TO CSS AND HTML WEB DESIGN
72
Web-safe fonts
Print designers have a world of fonts at their disposal, but the same isn??™t true online.
Pages:
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142