每次都要寫一遍相似的,因此先把代碼存在這裏,留着之後用bash
.ellipsis {
position: relative;
line-height: 1.5;
overflow: hidden;
max-height: 37px;
}
.ellipsis::before {
content: "...";
position: absolute;
z-index: 1;
bottom: 0;
right: 0;
width: 26px;
padding-left: 10px;
box-sizing: border-box;
background-color: white;
}
.ellipsis::after {
content: "";
display: inline-block;
position: absolute;
z-index: 2;
width: 100%;
height: 100%;
background-color: white;
}
複製代碼