在移动设备上停用输入自动缩放 [英] Disable input auto-zooming on mobile devices
问题描述
问题是移动浏览器会放大输入字段或选择焦点上的下拉菜单。我已经研究了不同的解决方案,到目前为止,我发现将其设置一个输入字段的字体大小为16px的最优雅。这在一个独立的输入字段工作正常,但如果你有一个父容器合并一个按钮,将字体大小更改为16px将使一些空格下的按钮。
The issue is mobile browsers will zoom in an input field or select drop-down on focus. I've looked into different solutions and so far the most elegant I found does it with setting a font-size of an input field to 16px. This works fine on a standalone input field but if you have a parent container which incorporates a button, after changing font-size to 16px will make a bit of a gap under the button.
另一种解决方案是将输入字段的默认字体大小设置为16px,并正确调整按钮大小。
Another solution would be to set a default font-size for input fields to 16px and adjust a button size correctly.
将字体大小设置为16px不会阻止缩放选择下拉。
Setting a font-size to 16px doesn't prevent select drop-downs from zooming though.
推荐答案
您可以这样做:
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
这篇关于在移动设备上停用输入自动缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!