How to wrap long lines without spaces in HTML?

前端 未结 14 1941
旧巷少年郎
旧巷少年郎 2020-12-01 03:28

If a user types in a long line without any spaces or white space, it will break formating by going wider than the current element. Something like:

HA

14条回答
  •  北荒
    北荒 (楼主)
    2020-12-01 04:03

    I haven't personally used it, but Hyphenator looks promising.

    Also see related (possibly duplicate) questions:

    • word wrap in css / js
    • Who has solved the long-word-breaks-my-div problem? (hint: not stackoverflow)

提交回复
热议问题