Disable input auto-zooming on mobile devices

邮差的信 提交于 2019-12-08 06:01:50

问题


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.

Another solution would be to set a default font-size for input fields to 16px and adjust a button size correctly.

Setting a font-size to 16px doesn't prevent select drop-downs from zooming though.


回答1:


You can do it this way:

 <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">


来源:https://stackoverflow.com/questions/24310074/disable-input-auto-zooming-on-mobile-devices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!