html处理文字换行

1.word-break:break-all.只对英文起作用,以字母作为换行依据
2.word-wrap:break-word. 只对英文起作用,以单词作为换行依据
3.white-space:pre-wrap.只对中文起作用,强制换行
4.white-space:nowrap.强制不换行,都起作用
5.white-space:nowrap.
overflow:hidden
text-overflow:ellipsis.
不换行,超出部分隐藏且以省略号形式出现
注意,一定要指定容器的宽度,不然的话是没有用的。
注意word-break 是IE5+专有属性

猜你喜欢

转载自blog.csdn.net/weixin_42625306/article/details/83421400