
CSS-Tricks · 4 min readCSS & layout
Strings in text-overflow: A Win for Truncated Text
text-overflow now accepts custom strings, letting developers replace clipped text with symbols or words that convey truncation intent. The article shows required CSS settings, single- and two-value syntaxes, and upcoming fade() options, enabling richer UI cues for overflow handling.
- Set inline-size, white-space:nowrap, and overflow-inline to hide overflow before applying text-overflow
- Custom strings like "—" or "[truncated]" replace clipped characters, while empty string removes them
- Two-value syntax can add strings to both start and end of scrollable overflow containers