手机端1像素边框

手机端1像素边框

css代码:

    .folder li{
        border-bottom: 1px solid #DDDDDD;
        padding: 8px 0 8px 15px;
        color: #7C7C7C;
        cursor: pointer;
        position: relative; /*相对定位*/
    }
    
    /*使用伪类*/
    .folder  li:before{
        position: absolute; /*绝对定位*/
        top: -1px;
        left: 0;
        content: '';
        width: 100%;
        height: 1px; /*1px*/
        border-top: 1px solid #DDDDDD;
        -webkit-transform: scaleY(.5);
        transform: scaleY(.5);  /*y轴方向缩小为0.5倍*/
    } 

html代码:

    <div id="" class="folder">
        <ul>
            <li>同样是retina屏幕下的问题,根本原因:1px使用2dp渲染</li>
        </ul>
    </div>

效果:

原文地址:https://www.cnblogs.com/ooo0/p/6528180.html