If none of the font names defined in a font
or font-family
declaration are available on the browser of the user, the
browser will display the text using its default font. It’s recommended to always define a generic font family for each declaration of
font
or font-family
to get a less degraded situation than relying on the default browser font. All browsers should implement
a list of generic font matching these families: Serif
, Sans-serif
, cursive
, fantasy
,
Monospace
.
Noncompliant Code Example
a {
font-family: Helvetica, Arial, Verdana, Tahoma; /* Noncompliant; there is no generic font family in the list */
}
Compliant Solution
a {
font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif;
}
See