我正在try 创建一个包含两个图像的div,您可以在其中水平滚动.每个图像都应该是div的完整大小,当向右滚动时,您会显示下一个图像.我的问题是,在div中只显示第一个图像的右半部分,而第二个图像的左半部分在它旁边可见.当你滚动时,你可以看到第二张图片的右半部分.我如何才能使第一张图像的整体可见?
.carousel {
height: 74%;
width: 85%;
margin-left: 7.5%;
margin-top: 0.5%;
display: flex;
align-items: center;
justify-content: center;
overflow: scroll;
overflow-y: hidden;
}
.carousel img {
width: 85vw;
height: 74vh;
min-width: 100%;
}
<div class="carousel">
<img src="https://via.placeholder.com/600x400">
<img src="https://via.placeholder.com/600x400/dddddd">
</div>