iPad 条件 CSS 不起作用
我已经阅读了这里的几个问题以及 Google 寻找的东西,我发现了很多,但由于某种原因我无法让我的问题适用于 iPad。我能够让它在 iPhone 上运行,但 iPad 仍然显示我的 bg img。这些都是我尝试过但空手而归的所有查询。
@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;
}
}
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;
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
愿你的 html 头部有
Meta
。像这样:使用媒体查询
May you have
Meta
in you html head. like this:with that media query