标签:pre span position 标签 背景 psi hit 添加 vertica
css--两行显示省略号兼容火狐浏览器
正常写法:
.ellipse1{overflow: hidden;white-space: nowrap;text-overflow: ellipsis;} .ellipse2{overflow:hidden; text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;}
总结下来就是:固定的宽度,强制不换行,超出隐藏,显示省略号。四个属性
但是在火狐下不兼容:
兼容做法:
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%); }
标签:pre span position 标签 背景 psi hit 添加 vertica
原文地址:http://www.cnblogs.com/intelwisd/p/7840407.html