CSS text-box-trim

Take back space from above and below your text content; achieve optical balance.

Published: Jan 14, 2025

From Chrome 133, text-box lets developers and designers tailor the space above and below text.

Browser Support

  • Chrome: 133.
  • Edge: 133.
  • Firefox: not supported.
  • Safari: 18.2.

Source

Longhand:

text-box-trim: trim-start | trim-end | trim-both | none;
text-box-edge: cap | ex | text | leading + alphabetic | text;

Shorthand:

text-box: trim-both cap alphabetic;

This property lets you control the space above and below text, for example

,