1、css 解决单行文本溢出
p{
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
2、css 解决多行文本溢出
p{
height: 40px;
line-height: 20px;
overflow: hidden;
position: relative;
}
p::after{
content: "...";
width: 70%;
position: absolute;
bottom: 0;
left: 30.2%;
padding-left: 3px;
background: -webkit-linear-gradient(left, transparent, #fff 0%);
background: -o-linear-gradient(right, transparent, #fff 0%);
background: -moz-linear-gradient(right, transparent, #fff 0%);
background: linear-gradient(to right, transparent, #fff 0%);
}