移动端1px 边框

伪类+ transform
.border_1px:before{
          content: '';
          position: absolute;
          top: 0;
          height: 1px;
           100%;
          background-color: #000;
          transform-origin: 50% 0%;
        }
        @media only screen and (-webkit-min-device-pixel-ratio:2){
            .border_1px:before{
                transform: scaleY(0.5);
            }
        }
        @media only screen and (-webkit-min-device-pixel-ratio:3){
            .border_1px:before{
                transform: scaleY(0.33);
            }
        }

设备像素比device pixel ratio简称dpr,即物理像素和设备独立像素的比值。
scaleY(y) 通过设置 Y 轴的值来定义缩放转换。

原文地址:https://www.cnblogs.com/whkl-m/p/10951192.html