是否有可能使像下面这样的长字符串出现在下一行(在一个段落中)而不打断长/短字符串中的字符?如果出现长字符串,则完整的字符串需要放在下一行。 (第一行没有半个字,下一行剩下一半。)
目前是这样显示的,
My sample text ha
s errors as it is
displaying a long
strings in next l
ine with breaking
the word.
我需要这样,
My sample text has
no errors as it is
displaying a long
strings in next
line with breaking
the word.
请给我任何 jsfiddle 或任何东西的例子。
提前致谢!
最佳答案
试试这个
word-break: keep-all;
代替
word-break: break-all;
关于javascript - 段落中的长字符串,不打断完整字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23424164/