1. 单行省略号和多行省略号
单行省略号
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
多行省略号
- 注意:
webpack
打包之后,会丢失-webkit-box-orient: vertical
- 要加上
autoprefixer
忽略删除该过期样式规则,有块级和单行二种写法,二选一来使用就可以了
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
//块级
/*! autoprefixer: off */
-webkit-box-orient: vertical
/*! autoprefixer: on */
//单行
/*! autoprefixer: ignore next */
-webkit-box-orient: vertical