Css 仅媒体屏幕不加载新背景
我有一个网站,我使用一个div作为背景(与将其放在身体中相反,因为我需要将其正确居中) 这里是网站 以下是css:Css 仅媒体屏幕不加载新背景,css,mobile,background,Css,Mobile,Background,我有一个网站,我使用一个div作为背景(与将其放在身体中相反,因为我需要将其正确居中) 这里是网站 以下是css: @media only screen and (min-device-width : 320px) and (max-device-width : 480px) { .backgroundwrapper { background-image: url('images/asystec-mobile-bg.jpg'); background-position:center 188p
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
.backgroundwrapper {
background-image: url('images/asystec-mobile-bg.jpg');
background-position:center 188px;
}
}
.backgroundwrapper {
background: #fff url('images/pageBgOld.jpg') no-repeat;
background-position:center 188px;
height:1903px;
width:1903px;
}
我尝试过清除浏览器上的缓存,但肯定是加载了pageBgOld图像,而不是新图像。
任何帮助都会很好。根据您的主要风格编写媒体查询。这样写:
.backgroundwrapper {
background: #fff url('images/pageBgOld.jpg') no-repeat;
background-position:center 188px;
height:1903px;
width:1903px;
}
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
.backgroundwrapper {
background-image: url('images/asystec-mobile-bg.jpg');
background-position:center 188px;
}
}