text-box

The shorthand property for 'text-box-trim' and 'text-box-edge'. It provides a concise way to control how a text box's vertical space is calculated and trimmed.

h2 {
  /* Trims both sides of the text box using capital letters and the baseline as bounds */
  text-box: trim-both cap alphabetic;
}
Initial value
normal
Inherited
No
Applies to
blockContainersAndInlineBoxes
Animation type
discrete

Values

normaltext-box-trimtext-box-edge
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