我有一个包含以下内容的 div
。
hai hello ho
w are you wh
ere are you?
但我希望单词出现在下一行,而不是像下面这样中断。
hai hello
how are you
where are
you?
我需要应用什么CSS样式?
谢谢!
最佳答案
您可以使用以下抄送:
.wrap {
word-wrap: break-word;
width: 100px;
}
使用以下 html:
<div class="wrap">
hai hello how are you where are you?
</div>
关于HTML换行到下一行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29677447/