css3溢出隐藏的方法(css隐藏的几种方法)一篇读懂

随心笔谈1年前 (2023)发布 admin
142 0


p{position: relative; line-height: 20px; max-height: 40px;overflow: hidden;}
p::after{content: “…”; position: absolute; bottom: 0; right: 0; padding-left: 40px;
background: -webkit-linear-gradient(left, transparent, #fff 55%);
background: -o-linear-gradient(right, transparent, #fff 55%);
background: -moz-linear-gradient(right, transparent, #fff 55%);
background: linear-gradient(to right, transparent, #fff 55%);
}

© 版权声明

相关文章