But it is nice to think about, and one day it
may be a reality. (Even then, the browser will never install the font
on the user??™s computer but merely use it to display the page.)
Until the happy day when fonts are available on demand, in order
to use speci?¬? c fonts with CSS, you need to list the fonts, in order of
preference, in which you would like the document to be displayed.
This list must only be by family name??”by that I mean you must use
Helvetica or Times, not Helvetica Condensed or Times Expanded.
It is accepted practice to write a CSS declaration specifying a number
of either serif or sans-serif fonts starting with the one you prefer
?¬? rst and ending with a generic font name such as serif or sans-serif.
Here??™s an example with sans-serif fonts
body {font-family:"trebuchet ms", helvetica, arial, sansserif;}
In the previous example using the font-family property, I am saying
to the browser, ???Display this document in Trebuchet MS, and if
you don??™t have it, use Helvetica. If you don??™t have either of those, use
Arial, and if all else fails, use whatever generic sans-serif font you
do have.??? It is very important to make the last item of a font-family
declaration a generic declaration of either serif or sans-serif as a ?¬? nal
fallback. This ensures that, at a minimum, your document at least
displays in the right type (no pun intended) of font.
Pages:
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112