Menu

1 / 2

Chrome 157 joins Firefox on custom text-overflow strings, with Safari in beta

DEV Community: css·Leo·1 day ago
#Y3mVun7N
#devtocss#devto#dev#overflow#line
Long article (667 words) — no AI summary yet.
Reading 0:00
15s threshold

This one has been sitting in Firefox for fifteen years. Firefox shipped text-overflow: <string> in Firefox 9, back in 2011. Daniel Schwarz reports on CSS-Tricks that Chrome 157 has now implemented it and Safari 27.3 Beta has shipped it as well, so he expects it to reach Baseline soon. Note the word "expects". Baseline isn't declared yet, and the Safari support is still in a beta.

What it does is small and very welcome. Truncated single-line text used to end in one of two ways, ellipsis or clip . Now the value can be any string you put in quotes.

What changed

The single-value syntax takes a string in place of a keyword. Here's the example from the article, which cuts the line off with an em dash:

div { inline-size : 170px ; white-space : nowrap ; overflow-inline : hidden ; text-overflow : "—" ; }

Enter fullscreen mode

Exit fullscreen mode

Schwarz points to the editorial reasons you'd want something other than an ellipsis.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.