HTML and CSS Reference
In-Depth Information
The typeface used for rendering text and its particular characteristics
such as size and weight are defined using
font
and its related properties.
The
font-family
property accepts a comma-separated list of font family
names. The first value in the list that is installed on the device used to
read the page is the font that will be used to style the text.
h1 {
font-family: “Does Not Exist”, Arial, sans-serif;
}
In the previous code, the font name would be checked; if the font Does
Not Exist is not available, the next font Arial would be looked for, and so
on, until the generic family
sans-serif
was matched and used. In some
cases, font names vary a bit between Windows and Mac, so both names
would be listed, like so:
p {
font-family: “Palatino Linotype”, Palatino; /* Windows
Version, Mac Version */
}
Generic
font-family
keywords have been created to map to a browser-
or system-defined font family for the specified category of fonts. The
preference dialog boxes for each browser typically allow users to select
their preferred font family for some of these categories.
■
serif
: A typeface style typically denoted by flourishes or flared ends
on each character; typically Times New Roman