iPad conditional CSS isnt working

杀马特。学长 韩版系。学妹 提交于 2019-12-11 16:32:46

问题


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;

}
}

回答1:


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

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

with that media query

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

body.custom-background {

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

}
}


来源:https://stackoverflow.com/questions/9188127/ipad-conditional-css-isnt-working

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