Font properties
font-family— the typeface, with fallbacks:Arial, Helvetica, sans-seriffont-size—16px,1.2remfont-weight—normal,bold, or100–900font-style—normal,italic
Generic families
Always end the list with a generic family: serif, sans-serif, monospace. The browser uses it if other fonts are missing.
Google Fonts
Add a font link in the <head>, then use the font name:
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap" rel="stylesheet">
font-family: 'Poppins', sans-serif;
Shorthand
font: italic bold 18px/1.5 Arial, sans-serif;
Example
Example — Font families and weights
HTML
<style>
.serif { font-family: Georgia, serif; }
.sans { font-family: Arial, sans-serif; }
.mono { font-family: 'Courier New', monospace; }
.bold { font-weight: 700; }
.italic { font-style: italic; }
p { font-size: 1.2rem; }
</style>
<p class="serif">Serif font (Georgia)</p>
<p class="sans">Sans-serif font (Arial)</p>
<p class="mono">Monospace font</p>
<p class="sans bold">Bold text</p>
<p class="sans italic">Italic text</p>