Rather than five separate declarations, the font shorthand sets several font properties at once — but it has a strict required order.
p {
font-style: italic;
font-weight: bold;
font-size: 18px;
line-height: 1.5;
font-family: Arial, sans-serif;
}p {
font: italic bold 18px/1.5 Arial, sans-serif;
}| Order | Value | Required? |
|---|---|---|
| 1 | font-style | Optional |
| 2 | font-weight | Optional |
| 3 | font-size / line-height | font-size required, line-height optional (with a slash) |
| 4 | font-family | Required — must be listed last |
The two required parts
font-size and font-family are the only two parts that can't be skipped — leaving either out makes the whole shorthand invalid, silently falling back to default font styling.