启用移动网站缩放 [英] Enable zoom in mobile website
问题描述
我正在开发一个移动网站.但是缩放效果在我的页面上不起作用.我在页面中使用了以下标记.
I'm developing a mobile web site. But the zoom effect is not working on my pages. I've used the following tag in the pages.
<meta name="viewport"
content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
我想知道:
是否可以通过此标签获得缩放效果以及如何正确使用它?
Is it possible to get the zoom effect with this tag and how to use it in correct way?
是否还有其他标签可以用于此目的?
Are there any more tags I can use for this purpose?
我们的客户群主要使用 iPhone.在为 iPhone 用户开发移动网站时,我应该考虑/使用哪些特殊的东西/技术?
Our client base is mostly on iPhone. Are there special things/techniques I should consider/use when developing a mobile web site for iPhone users?
推荐答案
这是因为您已将最大比例设置为最小量 (1.0),这意味着它不会超出最初渲染的范围进行缩放.您需要在该元标记中将最大比例设置为 1.0 和 10.0 之间的其他值.Apple 的默认设置是根据 Apple 的文档.
This is because you've set the maximum-scale to the minimum amount (1.0) which means it won't be zoomable beyond what is rendered initially. You need to set the maximum-scale to something else between 1.0 and 10.0 in that meta tag. The default by Apple is to have the maximum-scale as 5.0 as per Apple's Documentation.
Apple 的元标记文档 有一个关于视口属性的表格,其中列出了所有可以使用的视口元标记
Apple's Documentation on Meta Tags has a table on Viewport properties which list all the viewport meta tags which can be used
这篇关于启用移动网站缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!