关于word-break和word-wrap
最近在做一个英文试卷展示的页面。 遇到英文单词在换行时总是被切割开了。
试了试多种css样式,最终运用word-wrap:normal才把他搞定。
查了资料, word-wrap和word-break到底有啥区别,, 我一直没搞清楚。
word-wrap:
Sets or retrieves whether to break words when the content exceeds the boundaries of its container
设置或检索当当前行超过指定容器的边界时是否断开转行。
word-break:
Sets or retrieves line-breaking behavior within words, particularly where multiple languages appear in the object
单词内自动换行。
这两者的具体区别还是参照这位兄弟写的吧:
http://webcode.iteye.com/blog/476036
http://cindysaj.iteye.com/blog/670465
本文探讨了在英文文档排版中遇到的单词换行问题,并详细对比了CSS属性word-wrap与word-break的区别及应用。通过实际案例,介绍了如何使用这些属性来优化文本布局。
1121

被折叠的 条评论
为什么被折叠?



