wxss样式问题
发布于 5 年前 作者 tmo 3299 次浏览 来自 问答
.single-box{
  /* border: 1rpx solid red; */
  width: 690rpx;
  margin: 0 auto;
  height: 150rpx;
  border-bottom: 1rpx solid #47494d;
  display: flex;
  align-items: center;
}
 
.single-box:last-child{
 width: 690rpx;
  margin: 0 auto;
  height: 150rpx;
  border-bottom: 1rpx solid #ffaeca;
  display: flex;
  align-items: center;
}

想用:last-child改变最后一个single-box的底框颜色。可是实现不了。

   

3 回复

这个层可能不是同级下的最后一个元素

single-box的父元素的last-child吧?

写个代码片段看看呢

回到顶部