我在一个网站工作(Revogue)。我试图禁用手机缩放功能但它没有工作。我尝试了很多元视频...请帮忙我((
<meta name="viewport" content="user-scalable=0, initial-scale=1, maximum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<meta name="HandheldFriendly" content="true" />
答案 0 :(得分:0)
这应该是禁用缩放所需的全部内容:
<meta name="viewport" content="user-scalable=no" />
如果您的浏览器仍在缩放,请确保没有&#34;强制缩放&#34;已启用辅助功能设置。在Chrome中它位于&#34;三点菜单&#34; - &gt;设置 - &gt;可访问性。
答案 1 :(得分:0)
你必须在css文件中配置才能工作,就像这样
<style>
@-ms-viewport{
user-zoom:fixed;
max-zoom:2;
min-zoom:2;
}
body, html{
margin:0;
overflow:hidden;
-ms-content-zooming:none;
-ms-overflow-style:none !important;
background-color: #ccc;
width:720px;
height:480px;
}
</style>