CSS伪类实现0.5px底边分隔线

  • div-class为需要添加0.5px边框的元素的类名,下面是less写法,css写法把嵌套的&::after提出来,换成.div-class::after
.div-class {
  position: relative;
  &::after{
    position: absolute;
    bottom: 0;
    content:'';
    width: 100%;
    height: 1px;
    background-color: #F1F1F1;
    transform: scaleY(0.5);
  }
}
posted @ 2023-05-15 20:21  jiazq  阅读(128)  评论(0)    收藏  举报