我制作了一个带有<input>标签的HTML页面type="text".当我在iPhone上使用Safari点击它时,页面变大(自动缩放).有人知道如何禁用它吗?
我编写了一个小型Web应用程序来收集一些数据并将其存储在中央数据库中.我走来走去,阅读价值观并在我的Android智能手机上输入网站.这只适合我,因此这次没有适用的公共可用性问题.
现在我想添加一个按钮来增加一个读数,我需要能够多次按下该按钮.但是,如果我执行得太快,浏览器会识别双标签并缩放/缩放到页面中.
我已经添加了一个视口标题,并且可以使用我在网络上找到的每个值组合.但页面仍然可扩展.我怎么能阻止它?
这是一个对我来说失败的最小测试页面:
<!doctype html>
<html>
<head>
<title>Test page</title>
<meta name="viewport" content="width=device-width, user-scalable=no" />
<style type="text/css">
body
{
font: 16pt sans-serif;
}
</style>
</head>
<body>
This is a test page. It should not be scalable by the user at all. Not with the two-pinger pinch gesture and even less with a double-tap on the text.
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
添加initial-scale = 1,maximum-scale = 1和各种target-whateveritwas-dpi不会改变事物.我已重新启动浏览器(Dolphin HD和股票浏览器)并已清除缓存.我在Android 2.2上,手机是HTC Desire.
我想在 Android Firefox(可能是 iOS Safari)上聚焦 HTML 输入字段时禁用自动缩放。
我在 SO [1,2,3] 和网络上阅读了许多相关的古老线程,但既没有找到可行的解决方案,也没有找到明确的答案,即这在 2021 年是不可能的。我唯一的测试设备是 Android手机(iOS 也可能出现这种情况),仅 Firefox 会出现此问题;Chrome 按我的预期工作。
我努力了:
font-size: 16px输入字段上的设置<meta name="viewport" content="width=device-width, initial-scale=1, max-scale=1" /><meta name="viewport" content="width=device-width, initial-scale=1, max-scale=1, user-scalable=no">安卓 11、火狐 93.1.0
难道我想要达到的目标真的不可能实现吗?