1px 下划线solid的问题

1 物理像素线,也就是普通屏幕下 1px,高清屏幕下 0.5px的情况,采用transform属性 scale 实现即可。

.mod_grid {
    position: relative;
    &::after {
        content: '';
        position: absolute;
        z-index: 1;
        pointer-events: none;
        background-color: #ddd;
        height: 1px;
        left: 0;
        right: 0;
        top: 0;
        @media only screen and (-webkit-min-device-pixel-ratio: 2) {
            -webkit-transform: scaleY(0.5);
            -webkit-transform-origin: 50% 0%;
        }
    }
}
原文地址:https://www.cnblogs.com/CyLee/p/8626920.html