text-box-edge
Newly availableSince 202690% of users
Works with 'text-box-trim' to define which metric (like the 'cap height' or 'alphabetic' baseline) should be used as the boundary when trimming the space around a block of text.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyModernIn every major browser since August 2026. Widely available around February 2029.
See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
auto- Inherited
- No
- Applies to
- block containers and inline boxes
- Animation type
- discrete
Quick example
h1 {
text-box-trim: both;
/* Trims the box exactly to the top of the capital letters and the bottom of the baseline */
text-box-edge: cap alphabetic;
}Values
autotext-box-edge browser support
BaselineNewly availableSince 2026 this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.Works in all modern browsers. May need a fallback for older browsers.
Usage90%of people can use this10% use a browser without it.
Browsers
133+
154+
18.2+
133+Mobile
133+Android
154+Android
18.2+iOS