伪类+ transform
.border_1px:before{
          content: '';
          position: absolute;
          top: 0;
          height: 1px;
          width: 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 轴的值来定义缩放转换。

相关文章:

  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
  • 2021-08-14
  • 2020-07-22
  • 2021-09-04
猜你喜欢
  • 2018-07-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-03
相关资源
相似解决方案