我的网站和手持设备有问题。出于某种奇怪的原因,在尝试了大多数技术之后,我似乎无法让页面缩小或正确缩放以适合设备。
我的特定样式表的链接是有效的,只是元数据似乎不正常!这是一个 Wordpress 网站,目前这是我拥有的所有元数据:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
<?php if (is_search()) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>
在手机上查看网站时,它会被放大,您必须用手指来回移动。您无法放大或缩小。
有人知道为什么它不起作用吗?
最佳答案
您已关闭用户缩放功能。删除 user-scalable=0
,您应该可以解决该特定问题。
您还应该摆脱 maximum-scale
设置,除非您有理由不喜欢默认值,即 5。
"User-scalable: Determines whether or not the user can zoom in and out—whether or not the user can change the scale of the viewport. Set to yes to allow scaling and no to disallow scaling.
The default is yes.
Setting user-scalable to no also prevents a webpage from scrolling when entering text in an input field.
Available in iOS 1.0 and later."
(注意:有时用 1 和 0 代替 true/false 和 yes/no。这里,你的 0 等同于 no。)
关于html - 无法让 iPhone 网站版本缩放/缩放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14201088/