The font-family property (CSS Reference)
Introduction
The font-family property can be used to set the family name
or a generic name. The family names are the font names, like ‘Times New Roman’,
Arial, and Comic Sans MS etc. The following five pre-defined generic names exist:
cursive, fantasy, monospace, sans serif and serif.
It is a recommended setting that one
of these values is always placed as a last option for the browser. In the case that the browser
isn’t able to find the font it will use a generic font name and will be able to
display the output.
Example
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>font-family
Demonstration</title>
</head>
<hr/>
<span style="font-family:'Times New
Roman';font-size:200%">Text in Times New
Roman</span><br/><hr/>
<span
style="font-family:'serif';font-size:200%">Text in
Serif</span></p><hr/>
<span style="font-family:'Trebuchet
MS';font-size:200%">Text in Trebuchet
MS</span></p><hr/>
<span style="font-family:'Comic Sans
MS';font-size:200%">Text in Comic Sans
MS</span></p><hr/>
<span
style="font-family:'Arial';font-size:200%">Text in
Arial</span></p><hr/>
<body>
</body>
</html>
Output

Values
|
Name:
|
Description:
|
|
family-name
|
This can be used to define a list of font names which
should be used for the text.
|
|
generic-name
|
This value should be used to set a generic font name as a
last option. These values are always recognized by the browsers. You can use
one of the following options:
Cursive
fantasy
monospace
sans-serif
serif
|
|