在安卓手机上,不识别0.5px解决办法

使用css3缩放来解决,注意这种情况下,尺寸都要是原来的二倍

场景1:下边框

.box_item{
        position: relative;
 }
&:after{
          content: "";
          display: block;
          position: absolute;
          left: -50%; bottom: 0;
          width: 200%;
          height: 1px;
          background:rgba(0, 0, 0, 0.1);
          transform:scale(0.5);
          -webkit-transform:scale(0.5);
}

场景2:按钮全边框

.btn {
        position: relative;
}
.btn_border{
        position: absolute;
        width: 200%;
        height: 200%;
        left: -50%; top: -50%;
        border: 1px solid #ccc;
        border-radius: 4px;
        transform: scale(0.5);
        -webkit-transform: scale(0.5);
        box-sizing: border-box;
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。