如果我有一个特定宽度的 div
,并且它包含连续的内容,那么它就会溢出。有没有办法让它打破这个词并将它的一部分移动到下一行?例如:
<div style="float:left;width:200px;">thiscontentwilloverflowthedivbecuaseitdoesnthaveanyspacesinit</div>
谢谢。
最佳答案
添加以下CSS:
overflow:hidden; word-wrap:break-word
word-wrap 是 css3,所以它不适用于所有浏览器
关于html - 停止 div 内容溢出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9136896/