简体   繁体   English

适用于iPhone的“ width = device-width”,不适用于iPad

[英]“width=device-width” for iPhone but not for iPad

On my website I have the following meta tag : 在我的网站上,我具有以下元标记:

<meta name="viewport" content="width=device-width, initial-scale=1">

The following HTML : 以下HTML:

<body>
    <div class="content">
        <div class="inner clearfix">
        </div>
    </div>
</body>

And the following css : 和以下css:

.inner{width:1060px;}
@media screen and (max-width:640px){
    .inner{width:100%;}
}

My problem : on Ipad, the width of the page is blocked at 768px while my site is 1060px wide. 我的问题:在Ipad上,页面宽度被阻止为768px,而我的网站为1060px。 I would like the website to fit the width of the iPad, but I need to keep a 100% width on iPhone. 我希望网站适合iPad的宽度,但我需要在iPhone上保持100%的宽度。

Can you help me please? 你能帮我吗?

Thank you in advance! 先感谢您!

This will cover both portrait and landscape. 这将涵盖纵向和横向。

@media screen and (min-width: 768px) and (max-width: 1024px) {
    .inner { width: auto; }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM