简体   繁体   English

Android是否在提交按钮周围添加额外的活动区域?

[英]Does android add extra active area around submit buttons?

Android seems be to be increasing the clickable area of a submit button on an HTML form I'm working on. Android似乎正在增加我正在处理的HTML表单上的提交按钮的可点击区域。 It's as if there's about 25 pixels to the right of the submit button that are also tap-able. 好像在提交按钮的右边大约还有25个像素也是可以点击的。 This is problematic because, in my design, to the right of the submit button is an <A> element with an event handler bound to it. 这是有问题的,因为在我的设计中,提交按钮的右侧是一个<A>元素,该元素绑定了事件处理程序。 Tapping the <A> often submits the form instead of firing the event handler. 点击<A>通常会提交表单,而不是触发事件处理程序。 I'm doing most of my testing in Browerstack and some on real hardware. 我正在Browerstack中进行大部分测试,并在真实硬件上进行一些测试。 The problem exhibits in (virtual) devices with lower screen widths (eg 320px), and seems to be there in Android 2.3 and 4. The same pages in iPhone (4s, iOS6) and Blackberry (v7) don't exhibit the problem. 该问题出现在屏幕宽度较小(例如320px)的(虚拟)设备中,并且似乎出现在Android 2.3和4中。iPhone(4s,iOS6)和Blackberry(v7)中的相同页面均未出现问题。

Here's a CodePen example , and a single file version of the same code for easier viewing on mobile 这是一个CodePen示例 ,以及同一代码的单个文件版本 ,以方便在移动设备上查看

Has anyone else seen this? 其他人看到了吗? Is it a feature? 这是功能吗? A bug - either in Android or in my code? 一个错误-在Android中还是在我的代码中?

have you tried applying a reset.css to it? 您是否尝试过对其应用reset.css? It seems to be an android webkit issue. 这似乎是android webkit的问题。

Also, try to use 40px areas for tap buttons. 另外,尝试将40px的区域用于水龙头按钮。

I recommend using the reset.css stylesheet provided by meyerweb.com. 我建议使用meyerweb.com提供的reset.css样式表。 It removes (almost) all styling that browsers would apply, but you may find you need to rework a lot of css and put a lot of stuff in such as <h1> tags. 它删除了(几乎)浏览器将要应用的所有样式,但是您可能会发现需要重做大量的CSS并在<h1>标记中放入很多内容。

CSS Tools: Reset CSS CSS工具:重置CSS

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM