移动端开发的那些坑

在移动设备上,点击input会出现默认的灰色背景,如何才能去掉它。默认的阴影会把一些尺寸给暴露出来,很难看。

解决:

-webkit-tap-highlight-color:rgba(0,0,0,0);
tap-highlight-color:rgba(0,0,0,0);

 2 “表单中的input[type="submit"]和input[type="reset"]按钮在iPhone的safari浏览器下圆角有一个bug”

解决:

-webkit-appearance: none;

IOS移动端active不起作用:


[1] By default, Safari Mobile does not use the :active state unless there is a touchstart event handler on the relevant element or on the <body>.


即在iOS系统的移动设备中,需要在按钮元素或body/html上绑定一个touchstart事件才能激活:active状态。document.body.addEventListener('touchstart', function () { //...空函数即可}); 
原文地址:https://www.cnblogs.com/jill1231/p/5290110.html