使用伪类渲染边框线,最后一条不生效
.list_item {
//列表容器
display: flex;
align-items: center;
padding: 1rem;
position: relative;
//右边图片框
.r_left_icon {
img {
width: 1.5rem;
// 图片大小自行改变
}
}
// 右边文字
.r_right_txt {
padding-left: .5rem;
color: #000000;
}
// not取反 最后一项不生效
&:not(:last-child)::after {
position: absolute;
content: "";
width: 109%;
height: 1px;
background: #ccc;
bottom: 0;
left: -1rem;
}
/*
或者需要边框线
//列表后一个样式不生效
.list_item:last-child{
border: none;
}
*/
}