首页 > 解决方案 > 如何使用媒体查询在引导程序 4 中阻止特定宽度的视差?

问题描述

当屏幕宽度小于 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;
}}

谢谢您的帮助!

标签: cssbootstrap-4

解决方案


推荐阅读