iOS9关于网站的CSS有问题.css规则在android和iOS8上运行良好.但在iOS9上,网站搞砸了.这是ios8和ios9的区别.
有什么问题可以解决这个问题?感谢帮助.
CSS:
section.destinations {
float: left;
width: 82.5%;
display: inline-block;
position: relative;
overflow: hidden;
margin: 0 auto;
font-weight: 300;
font-size: 1.25em;
}
.content-wrap {
position: relative;
border-radius: 5px;
}
.content-wrap section {
margin: 0 auto;
max-width: 1200px;
text-align: center;
padding: 10px;
border-radius: 5px;
background-color: white;
display: block;
}
.destinations .promo {
position: relative;
background: #fff;
webkit-box-shadow: 0 0 2px rgba(0,0,0,1);
-moz-box-shadow: 0 0 2px rgba(0,0,0,1);
box-shadow: 0 0 2px rgba(0,0,0,1);
float: left;
width: 23%;
margin: 0 2.6% 20px 0;
font-size: 10px;
text-align: left;
display: block;
}
@media screen and (max-width: 600px){
section.destinations {
width: 100%;
}
}
@media screen and (max-width: 410px){
.full .one-fourth {
width: 100%!important;
margin: 0 auto 15px!important;
}
}
Run Code Online (Sandbox Code Playgroud)
HTML:
<section class="destinations clearfix full tabs tabs-style-tzoid">
<div class="content-wrap">
<section id="section-tzoid-1" class="content-current">
<!--column-->
<article class="one-fourth promo" style="">
</article>
<!--//column-->
<!--column-->
<article class="one-fourth promo" style="">
</article>
<!--//column-->
<div class="clearfix"></div>
</section>
</div>
</section>
Run Code Online (Sandbox Code Playgroud)
您偶然发现了 Web 环境中 IOS9 的主要问题之一。iOS9 不支持任何媒体查询。
如果你的类存在于特定屏幕尺寸的媒体查询中,它们将不会被读取,并且你的 CSS,你的输出在所有设备上看起来都与当前在 IOS9 中相同。该问题已被报告,但苹果目前尚未发布更新版本来解决此问题的时间表。
在我的网站上,我在显示中发布了一条警报:无;小于 1920 px 类的媒体查询只会在 ios9 设备上显示,并且只会在问题解决之前显示。
/* Device Alert (all screen, < 1920px only)*/
@media screen and (max-width: 1920px) {
<style>
.alert {
display:none;
}
</style>
}
<div class="alert">
IOS9 has caused display issues with this site. Please access the site on another platform until an update is issued.
</div>
Run Code Online (Sandbox Code Playgroud)
基本上,如果媒体查询被排除,则显示:无;。如果媒体查询不例外,则显示警报。
希望这对现在有帮助。