兼容版本比较好:
.addr_textarea{
width: 400rpx;
height: 80rpx;//高度=行高*行数
line-height: 80rpx;// 很关键 单行展示
position: relative;
overflow: hidden;
}
.addr_textarea::after {
content: '...';
position: absolute;
bottom: 0;
right: 0;
background: #fff;
}
单行省略:
.shenn{
max-width: 85%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
多行省略:
.xqpshen{
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
}
伪元素加*
.van-cell--required:before {
position: absolute;
content: "*";
left: 8px;
left: var(--padding-xs,8px);
font-size: 14px;
font-size: var(--cell-font-size,14px);
color: #ee0a24;
color: var(--cell-required-color,#ee0a24);
}
网友评论