ipad视口-比例和宽度之间的关系?
我对移动设备中使用的视口 mets 标签有点困惑:
<meta name="viewport" content="width=1024, initial-scale=1.4, maximum-scale-1.6, minimum-scale=0.25"/>
.
这是什么意思?我的意思是,我明白视口是什么……它是一个神奇的洞,你可以用它来观察固定大小的物体。 我知道您可能想要给孔一个宽度,因为这样您就可以确定一次可以看到多少固定大小的图像。
但为什么还要给它一个初始规模呢?重点是什么?为什么不将视口设置为您想要的任何值呢?初始规模增加了什么?
另外,最大值和最小值相加是什么?为什么我不希望用户能够按照他们认为合适的方式进行缩放(假设我不使用“user-scalabe=no”可选条目禁用缩放)?
I'm a bit confused by the viewport mets tag, for use in mobile devices:
<meta name="viewport" content="width=1024, initial-scale=1.4, maximum-scale-1.6, minimum-scale=0.25"/>
.
What does this thing mean? I mean, I get what a view port is... it is a magical hole that you can look at a fixed-size object with.
And I get that you might want to give the hole a width, because then you can determine how much of the fixed-size image you can see at a time.
But why also give it an initial scale? What is the point? Why not just set the viewport to whatever value you want it to be? What does the initial-scale add?
Also, what do the max and min values add? Why wouldn't i want the user to be able to scale as they see fit (assuming i don't disable the scaling with the 'user-scalabe=no' optional entry)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
按照 Apple 的规定,您不需要显式设置视口宽度...如果您仅指定初始比例 1,Safari 会假定纵向模式下的 width=device-width...
该比例仅控制视图的缩放级别页面...如果您将网站设计为特定的固定宽度/高度,您可能不希望用户能够放大或缩小。.
您可以查看以下链接以获取更多信息
http://developer.apple.com/ Library/IOs/ipad/#documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html
请记住viewport 主要只影响移动浏览器。
As per Apple, you do not need to explicitly set the viewport width...If you just specify an initial-scale of 1, Safari assumes width=device-width in portrait mode...
The scale just controls the zoom level of the page...If you have designed your site for a particular fixed width/height, you might not want the user to be able to zoom in or out..
You can checkout the following links for more info
http://developer.apple.com/library/IOs/ipad/#documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html
Do remember that viewport mainly affects the mobile browsers only..