开发者

CSS end line on letter

开发者 https://www.devze.com 2023-01-25 17:39 出处:网络
I\'m trying to get the text in a div with a fixed width to break on a letter instead of a word. I开发者_运维技巧 cant really think of a way to explain it so I made a little example. Any help would be

I'm trying to get the text in a div with a fixed width to break on a letter instead of a word. I开发者_运维技巧 cant really think of a way to explain it so I made a little example. Any help would be greatly appreciated.

What happens now.

|Hello   |
|World!  |

What I want:

|Hello Wo|
|rld!    |


word-wrap: break-word;

As per the CSS W3 Spec:

An unbreakable "word" may be broken at an arbitrary point if there are no otherwise-acceptable break points in the line. Shaping characters are still shaped as if the word were not broken, and grapheme clusters must together stay as one unit.

0

精彩评论

暂无评论...
验证码 换一张
取 消