HTML:
<div id="house-top"></div>
<div id="vse-doma-section-2"></div>
CSS:
#house-top {
height: 976px;
background-image: url('./img/house-top.png');
background-repeat: no-repeat;
background-size:100% auto;
}
#vse-doma-section-2 {
height: 567px;
background-image: url('./img/vse-doma-section-2.png');
background-repeat: no-repeat;
background-size:100% auto;
}
我的两张图片都有相同的width: 1920px
。我只想让一个div
置于另一个之下。此外,我想删除height
并使背景图像响应,但当我因高度div
而改变宽度时,看起来它有边距。
https://i.imgur.com/OmnrVxd.png https://i.imgur.com/GQSSXrv.png