1 回答

TA貢獻(xiàn)1786條經(jīng)驗(yàn) 獲得超13個(gè)贊
嘗試-webkit-line-clamp如下:
.cortar {
width: 135px !important;
height: 20px;
padding: 20px;
border: 1px solid blue;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
-webkit-transition: all 1s;
-moz-transition: all 1s;
transition: all 1s;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
/* from here */
box-sizing: border-box;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
如果它是編譯的一些 scss 文件,您可能需要添加autoprefixer. 我在使用時(shí)遇到了這個(gè)問(wèn)題angular。
.cortar {
width: 135px !important;
height: 20px;
padding: 20px;
border: 1px solid blue;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
-webkit-transition: all 1s;
-moz-transition: all 1s;
transition: all 1s;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: -webkit-box;
-webkit-line-clamp: 2;
/* autoprefixer: off */
webkit-box-orient: vertical;
/* autoprefixer: on */
}
- 1 回答
- 0 關(guān)注
- 114 瀏覽
添加回答
舉報(bào)