如何在HTML中包装没有空格的长行? [英] How to wrap long lines without spaces in HTML?
问题描述
如果用户输入长行,没有任何空格或空格,它将通过比当前元素更宽的宽度来破坏形成。例如:
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA ........................ ................................................. ................................................. .................
我试过只使用 wordwrap()
在PHP中,但问题是如果有一个链接或其他有效的HTML,它打破了。
CSS似乎有几个选项,但没有一个在所有浏览器中工作。请参阅IE中的换行。
如何解决这个问题?
我没有亲自使用它,但连字符看起来很有前途。 p>
另请参阅相关(可能重复的)问题:
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:
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA.............................................................................................................................................
I've tried just using wordwrap()
in PHP, but the problem with that is if there is a link or some other valid HTML, it breaks.
There seems to be a few options in CSS, but none of them work in all browsers. See word-wrap in IE.
How do you solve this problem?
I haven't personally used it, but Hyphenator looks promising.
Also see related (possibly duplicate) questions:
这篇关于如何在HTML中包装没有空格的长行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!