【发布时间】:2022-06-14 00:15:24
【问题描述】:
我的页面标题有问题,
我有一个 div,里面有 2 个 div,在第一个 div 中是背景作为背景,在第二个 div 中我有一个图像也作为背景,位于稍微下方,以产生从第一个 div 突出的效果.
我的问题是减小浏览器的大小,我想简单地减小所有内容并使其可读,第一个 div 表现良好,但是上面的图像并没有减小它的大小,所以它被剪切了不输入页面宽度。
我该如何解决这个问题?
header .container-fluid {
padding-left: 0;
padding-right: 0;
height: 550px;
position: relative;
}
header .banner {
background-image: url("../images/banner.png");
background-repeat: no-repeat;
background-position: center;
height: 500px;
width: 100%;
position: absolute;
bottom: -70px;
}
header .parallax {
height: 475px;
background-image: url("../images/banner_parallax.jpg");
background-repeat: no-repeat;
background-size: cover;
background-position: inherit;
background-attachment: fixed;
}
<header>
<div class="container-fluid">
<div class="parallax"></div>
<div class="banner"></div>
</div>
</header>
【问题讨论】: