当前位置: 代码迷 >> 综合 >> 安卓手机1px问题
  详细解决方案

安卓手机1px问题

热度:44   发布时间:2024-01-20 12:28:59.0

这是使用vue+less写的项目:

先用js判断是是否是安卓

if(!navigator.userAgent.match(/(iPhone|iPod|ios)/i)){ // 匹配安卓this.show1px = true;
}
<li v-for="item in list" :key="item.id" :class="{'scale-1px': show1px}"></li>
css
li{
   
&.scale-1px{position: relative;margin-bottom: 18px;width: 100%;border:none !important;&:after{content: '';position: absolute;top: 0;left: 0;
    z-index: -1;border-bottom: 1px solid @topbar;-webkit-box-sizing: border-box;box-sizing: border-box;width: 200%;height: 200%;-webkit-transform: scale(0.5);transform: scale(0.5);-webkit-transform-origin: left top;transform-origin: left top;}
}
}
可以改变
border-bottom
用来决定修改那边的边框的1像素,支持圆角

  相关解决方案