HTML and CSS Reference
In-Depth Information
14.4.3 Working with Fonts
The presentation of a document would be quite boring if you only had one font face and
size available. CSS lets you specify a style for the fonts in a document in a variety of ways—
by family, size, color, and others (see Table 14.6). There are a huge number of fonts to pick
from, although it's a good idea to specify fonts that users are likely to have installed. Like
the HTML <font> tag, CSS lets you specify several font families (see Table 14.7), and will go
from left to right, selecting the one available on your computer. See Figure 14.5 to sample
different font styles for your operating system.
Table 14.6 Font Properties
Elements
Affected
Property
Value/Example
font
12pt/14pt sans-serif, 80% sans-serif, x-large/110% arial,
normal small-caps
All
font-family
serif, sans-serif, cursive, fantasy, monospace; or any
specific font family typeface name may be used
All
font-size
12pt, larger, 150%, 1.5em
All
font-style
normal, italic, oblique
All
font-variant
normal, small-caps
All
font-weight
normal, bold, bolder, lighter, 100, 200...900
All
Table 14.7 Font Families
Family Names
Specific Family Typeface Names
Serif
Sans serif
Monospace
Cursive
Fantasy
 
 
Search WWH ::




Custom Search