禁用输入“文本"中的自动缩放标签 - iPhone 上的 Safari [英] Disable Auto Zoom in Input "Text" tag - Safari on iPhone
问题描述
我制作了一个带有 标签和
type="text"
的 HTML 页面.当我在 iPhone 上使用 Safari 单击它时,页面变大(自动缩放).有人知道如何禁用此功能吗?
I made an HTML page that has an <input>
tag with type="text"
. When I click on it using Safari on iPhone, the page becomes larger (auto zoom). Does anybody know how to disable this?
推荐答案
您可以阻止 Safari 在用户输入期间自动放大文本字段而不禁用用户的双指缩放功能.只需添加 maximum-scale=1
但省略其他答案中建议的 user-scale 属性.
You can prevent Safari from automatically zooming in on text fields during user input without disabling the user’s ability to pinch zoom. Just add maximum-scale=1
but leave out the user-scale attribute suggested in other answers.
如果图层中的表单在缩放时浮动",这可能会导致重要的 UI 元素移出屏幕,那么这是一个值得的选择.
It is a worthwhile option if you have a form in a layer that "floats" around if zoomed, which can cause important UI elements to move off screen.
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
这篇关于禁用输入“文本"中的自动缩放标签 - iPhone 上的 Safari的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!