给定一个块容器
<div> this is a very long string which contains a bunch of characters that I want to break at container edges. </div>
有没有任何css属性我可以设置强制它到达容器宽度时断开,不管字符串的内容,例如:
this is a ve ry long stri ng which ...
几乎是我想要的现在,似乎总是喜欢打破空格字符或其他特殊字符(如/).
解决方法
有一个名为word-break的CSS3属性将来可能会对你有所帮助.
更多信息,请访问:http://www.css3.com/css-word-break/
break-all值看起来要做你要求的事情:
Useful where content contains a majority of Asian character set content,to which this value behaves like ‘normal’. Non-Asian character set content may be arbitrarily broken across lines.