单词不断中断 HTML

Words keep breaking in HTML

我有一个由“

”和“

文本不能在单词之间中断,因为只使用了  s(用于 'non breaking space')。使用正常的 space 个字符。

p {
  background: teal;
  width: 150px;
  margin: 1em;
}
<p>This text has a long_long_word to test the issue</p>

<p>This&nbsp;text&nbsp;has&nbsp;a&nbsp;long_long_word&nbsp;to&nbsp;test&nbsp;the&nbsp;issue</p>

你试过“word-wrap: break-word;”吗?

我已经尝试过这个并且它有效。