正常设置超过多行,显示省略号(仅部分浏览器支持)
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
结果这样设置了,在vue+scss中不起作用,原因是,在scss编译的过程中,会去掉 -webkit-box-orient: vertical;的属性,需要在代码中添加
word-wrap: break-word;
word-break: break-all;
line-height: 30px;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 3;
/*!autoprefixer:off*/
-webkit-box-orient: vertical;
/*autoprefixer:on*/
height: 90px;
/*!autoprefixer:off*/
和 /*autoprefixer:on*/
,是把autoprefixer这个属性给自动跳过了
有的时候这样写会报错,这和你安装的scss loader版本有关,
警告’Autoprefixer applies control comment to whole block, not to next rules.’
/*! autoprefixer: ignore next */
-webkit-box-orient: vertical;
/* autoprefixer: on */