Is there a CSS-only way to break words on specific non-whitespace characters?
P粉807397973
P粉807397973 2023-09-10 20:24:04
0
2
759

If a word (e.g. THIS_PHRASE_HERE) overflows its inner div (fixed width), I want to split it with an underscore. I know I can use word-break:break-all to split a word on any character, but that seems a bit confusing, especially if there are 1 or 2 character orphans at the end. I'm sure I can do this with JS, but was wondering if there's a way to do it just in CSS, like word-break: "_".

P粉807397973
P粉807397973

reply all(1)
P粉663883862

Apparently there is no way to do this using just CSS, the word-break property doesn't have that option.
You can use the html tag wbr> to add work break opportunities where the browser can choose to break a line.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template