ios和安卓的兼容问题(不定期更新)

1. ios渐变色linear-gradient中使用的透明色transparent会发灰

  ios对background: linear-gradient(to right, transparent, #fff 32%)这个透明渐变色会发灰,改成background: linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 32%)即可

2. ios对position:fixed会出现页面抖动的情况,上下拉动滚动条时卡顿、慢

  如下布局可以解决

<header></header>//头部置顶
<div></div> //中间滚动
<footer></footer>//底部置底
header{
position:fixed;
top:0;
}

div{
 position: absolute;
 width: 100%;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 overflow-y: scroll;
 -webkit-overflow-scrolling: touch;/* 解决ios滑动不流畅问题 */      
}

footer{
position:fixed;
bottom:0;
}

 3. ios对xxxx-xx-xx格式的时间格式不支持,可支持xxxx/xx/xx格式

  通过time.replace(/-/g,'/'),可以全局替换时间的-为/,可解决

4.  ios的input框,会有灰色阴影问题,添加下面样式即可

input{
    -webkit-appearance: none;
}

4. ios对一些非点击元素(如span,lable),添加click事件的时候,会出现不触发的情况,css新增cursor:pointer;即可

  


原文地址:https://www.cnblogs.com/yhhBKY/p/14103149.html