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粉6638838622023-09-11 18:45:34
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.