安卓、IOS兼容性

ゝ一纸荒年。 2023-03-13 06:14 80阅读 0赞

安卓、IOS兼容性

1、IOS下input默认样式(圆角、阴影)

解决方案

  1. input {
  2. -webkit-appearance: none;
  3. border-radius: 0;
  4. border: 1px #ccc solid;
  5. }

2、在IOS下页面滑动卡顿,Android没问题

解决方案

  1. body { -webkit-overflow-scrolling:touch; overflow-scrolling: touch;}

3、input type 改为button

问题
当input type为button,disabled为true,会出现背景色异常(其实就是禁用的样式)
解决方案

  • 把input的disabled改为readonly
  • opacity:1

4、input type=text切换到英文输入法IOS下的问题

解决方案
input添加autocapitalize属性

  1. <input class="SmallFour" type="text" autocapitalize="off" />

5、禁止数字自动识别为电话号码

这个比较有用,因为一串数字在iphone的部分浏览器上会显示成蓝色,样式加成别的颜色也是不生效的。亲测,在微信内部浏览器没问题,但是在safari上有问题,IOS系统版本12.1.4

解决方案

  1. <meta name="format-detection" content="telephone=no" />

6、input type=number之后,pc端出现上下箭头

解决方案

  1. input::-webkit-inner-spin-button {
  2. -webkit-appearance: none !important;
  3. margin: 0;
  4. }

7、input type=number之后,pc端出现上下箭头

解决方案

  1. input::-webkit-inner-spin-button {
  2. -webkit-appearance: none !important;
  3. margin: 0;
  4. }

发表评论

表情:
评论列表 (有 0 条评论,80人围观)

还没有评论,来说两句吧...

相关阅读

    相关 ios样式兼容问题

    1.margin在IOS中失效    在页面中元素使用margin值,在某些IOS设备下会出现失效的情况,而安卓机则正常显示,此问题暂无直接的解决方案,当前使用空DIV控制