font: 20px Helvetica, sans-serif;
font-family (Inherited)
The font-family CSS pro perty allows you to specify the font in which the browser
will display text. It can happen that a precise font is not installed on a viewer’s
compute r—that’s why designers usually specify a list of two or more options. At
the end of the list there should always be one generic font family in case more sp e-
cific fonts are not available. In contrast to most other CSS properties, values of the
font-family property are delimited by commas to suggest that th ey are alter natives.
The browser will use the first of the fonts in the list that it finds on the computer.
Values
Any font family name can be used, such as, for example, "Helvetica" or "Courier
New". Quotes are not necessary unless names include spa ces.
The generic f ont families serif, sa ns-serif, monospace, fantasy, o r cursive
can be used. Generic names act as a fallback system: if the browser does not find any
font on the list, then it will use a gen eric font, which should always be specified last.
Generic font family names should not be q uoted because they a re keywords.
Examples
font-family: "Times New Roman", "Georgia", serif;
font-family: "Comic Sans MS", fantasy;
font-size (Inherited)
The font-size CSS property sets the size of the font—precisely the height of the
glyphs of the font. Because the actual f ont size is used for computing the value of the
em length unit, setting it may in turn aff ect the sizes of other objects.
While keywords such as xx-small or large can also be used with the font-size
property, many designers use only pixels, ems, or percentag es because the interpr eta-
tion of these keywords can vary between browsers.
Values
A positive <length> o r <percentage> value. If a relative unit or <perc entage> is used,
then th e font size is computed relative to the size of the font of the parent element.
xx-small, x-small, small , med ium, large, x-large, xx-large
Default Value
medium
344 CSS Reference