[英]Use viewport for iPhone only, not iPad
I'm using the following meta tag to display a site correctly in iPhone: 我正在使用以下meta标签在iPhone中正确显示网站:
<meta name="viewport" content ="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, width=device-width">
On iPad however, when using the meta viewport, the site is not correctly zoomed once loaded. 但是,在iPad上,使用元视口时,加载后该站点无法正确缩放。 Instead of showing the entire page, I have to scroll the right to see the hidden part of it.
除了显示整个页面,我还需要向右滚动以查看其隐藏部分。 Everything looks perfect though if not the meta viewport is not used.
一切看起来都很完美,即使不使用meta视口也是如此。
Is there a way to only use viewport for devices with width under 481px? 有没有一种方法只能将视口用于宽度小于481px的设备? Or is it possible to use CSS to archive what meta viewport does?
还是可以使用CSS来存档元视口?
For iPhone: 对于iPhone:
<meta name="viewport" content="width=device-width; initial-scale=0.65; maximum-scale=1.0;">
For iPad: 对于iPad:
<meta name="viewport" content="width=device-width; initial-scale=1; maximum-scale=1.0;">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.