css 设置连续数字、连续英文字母强制换行和多行显示省略号的方法


1、设置连续数字和连续英文字母换行

white-space: normal;
word-break: break-all;
word-wrap: break-word;

2、设置显示省略号方法

   一行显示省略号的方法,如下:

overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;

  多行显示省略号的方法,如下(设置2行后显示省略号):

word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;