文字溢出时省略号表示

单行文字省略:
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
多行文字省略:
display: -webkit-box;   
-webkit-line-clamp: 2;   //设定行数 
/* ! autoprefixer: off */    
-webkit-box-orient: vertical; 
/* autoprefixer: on */   
overflow: hidden;   
text-overflow: ellipsis;

注:请在 -webkit-box-orient: vertical; 上下添加如上注释,防止webpack打包时导致-webkit-box-orient: vertical丢失 


若控制台报警告:Second Autoprefixer control comment was ignored. Autoprefixer applies control comment to whole block, not to next rules
则将以上代码改为(改第三行)
display: -webkit-box;   
-webkit-line-clamp: 2;   //设定行数 
/*! autoprefixer: ignore next */
-webkit-box-orient: vertical;
/* autoprefixer: on */
overflow: hidden;   
text-overflow: ellipsis;
原文地址:https://www.cnblogs.com/huihuihero/p/11491826.html