常见的css换行样式
1、内容超出省略号显示
h1 {
width: 500px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
2、内容超出换行省略号显示
h1 {
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
line-clamp: 2;
-webkit-box-orient: vertical;
}
3、pre换行显示
pre {
white-space: pre-wrap !important;
word-break: break-all;
word-wrap: break-word;
}