我一直在做评论框,在查看我的评论后遇到了问题。我想要的只是让我的评论在超出容器时自动断线,但我现在得到的是一条直线。
例如:
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT我希望我的文字可以是这样的:
tttttttttttttttttttttttttttttttttttttt ttttttttttttttttttttttttttttttttttttt ttttttttttttttttttttttttttttttttttttt tttttttttttt ttttttttttttttttttttttttt
我应该用什么来让我的文本自动换行?
$line_broken = str_replace("\n", "<br />", $comment);
但是如果不看到你的代码就很难判断。
<wbr>
标记“建议的换行符”,也就是单词中可以进行换行的位置。
MySuperLongWord
默认情况下不会有换行符。
My<wbr>Super<wbr>Long<wbr>Word
必要时会在
<wbr>
处换行。
overflow: hidden;
或
overflow: auto;
作为评论容器。
<br>