Let??™s start with fonts.
Specifying Fonts in CSS
In this section, you??™ll learn how to use CSS to specify fonts. You
can use any acceptable length units, both absolute and relative, to
specify font sizes, but it??™s best to use a relative measurement such as
ems. Relative type sizing allows the user to easily scale the type to
other sizes by selecting an overall size from the Text Size setting (or
similarly worded option) in the View menu of the browser, or less
commonly, by adding a user style sheet.
STYLIN??™ FONTS AND TEXT 69
Introducing Font Collections
Example: body {font-family: sans-serif;}
Values: serif, sans-serif, monospace, fantasy, cursive
The simplest way to specify fonts in CSS is by using the ?¬? ve generic
collection names??”serif, sans-serif, monospace, fantasy, and cursive.
These generic names cause the user agent (browser, smartphone,
mobile phone, and so on) to serve up one of these font types.
Generic collection names represent the lowest level of support for
font styling, and as you will see in a moment, CSS offers some better
options than these.
Serif fonts, as shown in Figure 3.1, are so named because of the
little details, known as serifs, at the ends of the character strokes.
These are particularly noticeable in the uppercase letters. Examples
of serif fonts include Times New Roman, Georgia, and Palatino.
Pages:
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107