Font Family
Font family (font-family
) is simply a way to set the typeface. For example:
p {
font-family: Arial;
}
This sets the typeface of all paragraphs to Arial
. The reason we call it a font family and not a typeface is as follows:
p {
font-family: Arial, Helvetica, sans-serif;
}
As you can see, we can specify multiple typefaces. When we specify multiple typefaces, the browser will select the first functional typeface from our list and display it.
In the example given, the browser would want to display the Arial
typeface, but if it is not supported by the user's device, it would display the Helvetica
typeface. If neither of these typefaces is supported, it would display the sans-serif
typeface.
Instructions
Set the font family to Helvetica, sans-serif
for all elements (*
).
Start programming for free
2/9