解决0.5px转换成rem时在部分机型上面的兼容显示


.num-box {
    position: relative;
    overflow: hidden;
}
.num-box::before {
    position: absolute;
    top: 0;
    left: 0;
    box-sizing: border-box;
    width: 200%;
    height: 200%;
    border: 0.01rem solid #ff60a9;
    transform: scale(0.5) translate(-50%, -50%);
    content: '';
  }

使用scale(0.5)来解决px小的时候的展示问题

扩展:

scale(0.5)还可以用来解决移动端上下不居中的问题

CSS