我想在屏幕宽度小于800px时阻止视差效果,但是,看来我的CSS不能正常工作:
.parallax{
background-image:url(resources/newbg.png);
height:100vh;
background-attachment:fixed;
background-position:center;
background-repeat:no-repeat;
background-size:cover;
}
和屏幕尺寸的css:
@media (min-width: 800x) {
.parallax{
background-image:url(resources/newbg.png) !important;
height:100vh !important;
background-attachment:scroll !important;
background-position:center !important;
background-repeat:no-repeat !important;
background-size:cover !important;
}}
谢谢您的帮助!