text-fit
Limited availability67% of usersExperimental
Scales the font size of text so each line fills the full width of its box. grow makes text bigger to fit and shrink makes it smaller. consistent, used when you don't pick, scales every line by the same amount. per-line scales each line on its own but skips the last line, and per-line-all includes it. A percentage sets the limit. It works in Chrome and Edge 150 and later so far.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyComingNot in Firefox or Safari yet, so not every major browser supports it.
See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
none- Inherited
- Yes
- Applies to
- block container elements
- Animation type
- discrete
Quick example
.poster-title {
inline-size: 100%;
text-fit: grow per-line-all 400%;
}Values
nonegrowshrinkconsistentper-lineper-line-all<percentage>text-fit browser support
BaselineLimited availabilityThis feature is not Baseline because it does not work in some of the most widely-used browsers.Not ready for production without a fallback.
Usage67%of people can use this33% use a browser without it.
Browsers
150+
150+Mobile
150+Android