css rules doesn't work properly on iOS9

江枫思渺然 提交于 2019-12-04 10:01:49

You've stumbled on the one of the cardinal problems for IOS9 in a web environment. IOS9 does not honor any media queries.

if your classes live in a media query for a specific screen size, they won't be read and your css, your output will look the same on all devices as it currently does in IOS9. The issue has been reported but apple currently has not released a schedule for an updated version to resolve this.

In my site, ive posted an alert in a display: none; with a media query of less than 1920 px class that will only be displayed on ios9 devices and only until the problem is resolved.

/* 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>

Basically, if the media query is excepted, display:none;. If the media query is not excepted, display the alert.

Hope this helps for now.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!