给ul => li 中的最后一个li不加伪类after; 或者给最后一个和第一个不加伪类

最后一个不加伪类:

ul li:not(:last-child)::after {
  content: '';
  height: 14px;
  border: 1px solid #3c423f;
  position: absolute;
  top: 4px;
  right: 0;
}

 
给最后一个和第一个不加伪类:
 
 ul li:not(:first-child):not(:last-child)::after{
   content: '';
   left: 10px;
   bottom: 0;
   width: 210px;
   position: absolute;
   border-bottom: 1px solid red;
}
posted @ 2021-03-15 17:28  搬砖的苦行僧  阅读(694)  评论(0编辑  收藏  举报