The first container is working fine, displaying 2 images vertically, but when there are 6 images, it overflows.
The problem lies with container 2, where I want to create a horizontal list of images with overflow (only horizontal).
This is the current state of my CSS:
#container {
display: block;
width: 80%;
height: 40vw;
background: red;
margin-bottom: 50px;
}
#imglist {
display: block;
overflow: auto;
height: 40vw;
width: 40%;
}
#imglist div {
display: block;
width: 100%;
}
#imglist div img {
width: 100%;
}
/* Problem */
#container2 {
display: block;
width: 80%;
height: 20vw;
background: red;
}
#imglist2 {
overflow-x: scroll;
display: block;
width: 100%;
height: 15vw;
}
#imglist2 div {
width: 20%;
display: inline;
}
Refer to this JSFiddle for an example: https://jsfiddle.net/n4a2tc7s/