css最后一行如何去掉伪类?

clipboard.png

一个列表的布局,但最后一个很明显有边框,我不想让他出现。该怎么做呢 ?

.list{
    margin-top: 10px;
    li{
        display: flex;
        justify-content: space-between;
        position: relative;
        padding: 12px 15px;
        background-color: #fff;
        .right{
            font-size: 13px;
            color: #999;
        }
    }
    li:after{
        content: '';
        position: absolute;
        left: 15px;
        right: 0;
        bottom: 0;
        border-bottom: 1px solid #eee;
    }
}
阅读 4.5k
2 个回答

li:last-child:after{
content:'';
border-bottom: 0;
}

li:not(last-child):after

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题