Html 禁用缩放元标记
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29376761/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Disabling zoom meta tag
提问by Tommy D
What's the comlete version of the zoom disabling viewport meta tag?
禁用缩放的视口元标记的完整版本是什么?
I have tried with: <meta name="viewport" content="width=device-width, initial-scale=1">
我试过: <meta name="viewport" content="width=device-width, initial-scale=1">
but it just sets the appropriate scale and doesn't prevent zooming.
但它只是设置适当的比例,并不会阻止缩放。
I also tried with: <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,target-densitydpi=device-dpi, user-scalable=no" />
我也试过: <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,target-densitydpi=device-dpi, user-scalable=no" />
But it just doesn't work, I can still pinch zoom on my mobile.
但它不起作用,我仍然可以在我的手机上捏缩放。
回答by Tommy D
It finally worked using that this way:
它最终以这种方式工作:
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
without the closing /
没有关闭 /
回答by Amar Syla
You can use this:
你可以使用这个:
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,target-densitydpi=device-dpi, user-scalable=no" />