iPad条件CSS不工作 [英] iPad conditional CSS isnt working

查看:175
本文介绍了iPad条件CSS不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了这里的几个问题,以及谷歌寻找的东西,我发现很多因为某些原因,我不能让我的工作在iPad。我能够得到它工作的iPhones,但iPad仍然显示我的bg img。

I've read several of the questions on here as well as Google looking for stuff and I found a lot bu tfor some reason I can't get mine to work for iPads. I was able to get it working for iPhones but the iPad is still displaying my bg img. These are all the queries I've tried and came up empty handed.

    @media only screen and (min-device-width: 481px) and (max-device-width: 1024px) {

body.custom-background {

    background-color: #FFFFFF;
    background-image: none;

}
}

@media only screen and (min-width: 481px) and (max-width: 1024px) {

body.custom-background {

    background-color: #FFFFFF;
    background-image: none;

}
}

@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {

body.custom-background {

    background-color: #FFFFFF;
    background-image: none;

}
}

@media handheld and (max-device-width: 480px) {

body.custom-background {

    background-color: #FFFFFF;
    background-image: none;

}
}


推荐答案

您可以在您的html头中拥有 Meta 。像这样:

May you have Meta in you html head. like this:

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

与媒体查询

@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {

body.custom-background {

    background-color: #FFFFFF;
    background-image: none;

}
}

这篇关于iPad条件CSS不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆