html - 无法让 iPhone 网站版本缩放/缩放

标签 html css viewport meta handheld

我的网站和手持设备有问题。出于某种奇怪的原因,在尝试了大多数技术之后,我似乎无法让页面缩小或正确缩放以适合设备。

我的特定样式表的链接是有效的,只是元数据似乎不正常!这是一个 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."

http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html

(注意:有时用 1 和 0 代替 true/false 和 yes/no。这里,你的 0 等同于 no。)

关于html - 无法让 iPhone 网站版本缩放/缩放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14201088/

相关文章:

html - 悬停时向表格单元格添加左边框

javascript - 如何防止亚洲字符按字断行

html - 有视口(viewport)标签不工作的问题

HTML5 样板文件 : Meta viewport and width=device-width

html - &lt;input type ='image'/> 和 &lt;input type ='button'/> 上的奇怪 CSS 行为

html - 按钮中的垂直文本看起来很整洁

css - 如何使用 Sass mixin transition 仅应用 transition-delay?

css - 在另一个 ionic3 旁边放一个按钮

css - 如何组合::after 和 :not 伪选择器

javascript - 当 Javascript 仅为特殊视口(viewport)构建时,我如何实现它?