liveBook · Manning

Generic font

As explained in Web Design Playground

A fallback font category name in CSS that lets the browser choose an available font of a general type such as serif or sans-serif.

A generic font is a CSS font-family name for a broad typeface category rather than a particular typeface. It gives the browser a familiar kind of lettering to use. section 4.3

The five generic families are:

Use the font-family property to choose one. For example, you can give h3 headings a sans-serif font and p paragraphs a serif font. section 4.3

p {
    font-family: Lato, sans-serif;
}

A generic name can also come last as a backup. Here, paragraphs use Lato when its hosted font file loads; otherwise, they use sans-serif. Try swapping the generic name and see how the backup changes. section 18.6

How Web Design Playground covers it

How deep it goes
Defines five families and demonstrates direct selection and a hosted-font fallback, without detailing browser font-selection internals.
Examples
Shows sans-serif headings, serif paragraphs, and Lato paragraphs with a sans-serif fallback.
What it assumes
Introduces generic font selection through simple h3 and p styles before using it with hosted fonts.
What you can do after
Apply it via CSS font-family to choose a general font or back up a hosted one.
How it connects
Connects generic fonts to CSS font-family, typeface categories, and third-party hosted fonts.

Also explained in

Compare how 2 books explain generic font →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Design Playground. The section links point to the parts of the book it draws on.