files/en-us/web/css/reference/values/generic-family/index.md
The <generic-family> CSS data type represents the keyword values for generic font families used in the {{cssxref("font")}} shorthand and {{cssxref("font-family")}} longhand properties. The <generic-family> represents one or more locally-installed fonts belonging to that category of fonts.
The <generic-family> {{glossary("enumerated")}} type is specified using one of the values listed below:
serif
sans-serif
monospace
cursive
fantasy
system-ui
[!NOTE] As the name implies,
system-uiis intended to make UI elements look like native apps, and not for typesetting large paragraphs of text. It may cause the displayed typeface to be undesirable for some users—for example, the default Windows CJK font may render Latin scripts poorly, and thelangattribute may not affect the displayed font. Some operating systems do not allow customizingsystem-ui, while browsers generally allow customizing thesans-seriffont family. For large paragraphs, usesans-serifor some other non-UI font family instead.
ui-serif
serif above.ui-sans-serif
sans-serif above.ui-monospace
monospace above.ui-rounded
math
fangsong
{{CSSSyntaxRaw(<generic-family> = serif | sans-serif | monospace | cursive | fantasy | system-ui | ui-serif | ui-sans-serif | ui-monospace | ui-rounded | math | fangsong)}}
This example demos several of the <generic-family> enumerated values for the {{cssxref("font-family")}} property.
<ul>
<li class="serif">serif</li>
<li class="sans-serif">sans-serif</li>
<li class="monospace">monospace</li>
<li class="cursive">cursive</li>
<li class="fantasy">fantasy</li>
<li class="system-ui">system-ui</li>
</ul>
ul {
font-size: 1.5rem;
line-height: 2;
}
.serif {
font-family: serif;
}
.sans-serif {
font-family: sans-serif;
}
.monospace {
font-family: monospace;
}
.cursive {
font-family: cursive;
}
.fantasy {
font-family: fantasy;
}
.system-ui {
font-family: system-ui;
}
{{EmbedLiveSample("Examples", "500", "355")}}
{{Specifications}}