CSS Fonts allow you to control how text appears across your website. With font-related properties, you can change the typeface, size, weight, spacing, and apply custom web fonts to create a unique design.
The font-family property defines the typeface used for text.
p {
font-family: "Arial", sans-serif;
}
You can list multiple fonts as fallback options.
The font-size property controls how big or small the text appears. Common units:
h1 {
font-size: 2rem;
}
This property defines how bold or light text appears.
p {
font-weight: 600; /* semi-bold */
}
Used to apply italic or oblique styles.
em {
font-style: italic;
}
Controls vertical spacing between lines of text.
p {
line-height: 1.6;
}
Good line-height improves readability.
p {
letter-spacing: 1px;
word-spacing: 5px;
}
Useful for typography design.
You can load external fonts using @import or <link>.
Using <link>
body {
font-family: "Poppins", sans-serif;
}
Web fonts allow modern, stylish typography without needing local installation.
You can combine multiple font properties in one line:
p {
font: italic small-caps 600 18px/1.6 "Poppins", sans-serif;
}
Order matters here.