本篇文章记录一下css解决英文和数字导致换行或不换行的问题
强制换行
1、word-break: break-all; 只对英文起作用,以字母作为换行依据。
2、word-wrap: break-word; 只对英文起作用,以单词作为换行依据。
3、white-space: pre-wrap; 只对中文起作用,强制换行。
禁止换行
white-space:nowrap;
禁止换行,超出后隐藏,并加上省略号
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
white-space: nowrap;
text-overflow: ellipsis;