text-box-edge

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.

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;
}

Quick facts

Initial value
auto
Inherited
No
Applies to
block containers and inline boxes
Animation type
discrete

Values

auto

text-box-edge Browser Support

Limited availability 80% global usage

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Not ready for production without a fallback.

133+
18.2+
133+
ESC