font-size
Widely availableSince 201597% of users
Sets the size of the font. This is one of the most fundamental properties for defining the visual scale of text on a page.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyClassic, with newer partsIt has worked everywhere since July 2015, and it keeps getting newer values.
Newer parts of font-size
math keywordBaseline Mar 2026xxx-large keywordBaseline Mar 2023, Widely Sept 2025
See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
medium- Inherited
- Yes
- Applies to
- all elements and text
- Animation type
- byComputedValueType
Quick example
h1 {
font-size: 3rem;
/* 3x the base font size */
}
.small-print {
font-size: 0.875rem;
/* standard for smaller utility text */
}Values
length-percentagemathfont-size browser support
BaselineWidely availableThis feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.Safe to use without fallbacks.
Usage97%of people can use this3% use a browser without it.
Browsers
1+
1+
1+
12+Mobile
18+Android
4+Android
1+iOS