On this page
font-size
Prev: `font-family` | Up: typography | Next: `line-height`
Rel: typography, Typography & Color Guide
Ref: MDN Web Docs — font-size
Tags: #public #web #css #properties #typography #tier/core
Syntax & Overview
font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
Sets text size; use rem so user browser font preferences are respected.
- Initial:
medium (16px)| Inherited: Yes | Animatable: Yes
Notes & Best Practices
- Use
rem(notpx) so users' browser base font-size preferences scale your UI cleanly.
Example
body { font-size: 1rem; }
small { font-size: 0.875rem; }
Linked from
Related notes
- tuts/css/properties/typography/font-family Linked here; links to this page; shared tags: #css, #properties, #tier, #typography, #web
- tuts/css/properties/typography/line-height Linked here; links to this page; shared tags: #css, #properties, #tier, #typography, #web
- tuts/css/properties/typography Linked here; links to this page; shared tags: #css, #properties, #typography, #web
- tuts/css/properties/typography_and_color Linked here; shared tags: #css, #properties, #typography, #web
- tuts/css/properties/typography/accent-color shared tags: #css, #properties, #tier, #typography, #web
- tuts/css/properties/typography/color shared tags: #css, #properties, #tier, #typography, #web
- tuts/css/properties/typography/color-scheme shared tags: #css, #properties, #tier, #typography, #web
- tuts/css/properties/typography/text-wrap shared tags: #css, #properties, #tier, #typography, #web
- tuts/css/properties/box_model/aspect-ratio shared tags: #css, #properties, #tier, #web
- tuts/css/properties/box_model/box-sizing shared tags: #css, #properties, #tier, #web