I'm trying to set the nested images inside gallery to:
1) Wrap thumbs horizontally, i.e. in this example, one & two on first row and then below them 3 & 4 and so on..
2) Wrap thumbs vertically as well w/ wrapping thumbs moving up to top-rt & filling downward like first column.
3) Prevent thumbs from increasing gallery wrapper height & wrap instead. I tried setting gallerry to fixed height but still thumbs overflow.
<div id="list-wrapper">
<div id="gallery">
<div><img src="images/1.png" alt="one" /></div>
<div><img src="images/2.png" alt="two" /></div>
<div><img src="images/1.png" alt="three" /></div>
<div><img src="images/2.png" alt="four" /></div>
<div><img src="images/1.png" alt="five" /></div>
<div><img src="images/2.png" alt="six" /></div>
</div>
<div id="mainimg"><img src="images/lg.png" alt="large" /></div>
</div>
#list-wrapper {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
width: 100%;
flex-wrap: wrap;
}
#list-wrapper #gallery {
flex: 1 1 20%;
background-color:red;
width:200px;
}
#list-wrapper #gallery div {
width:100px;
height:100px;
}
#list-wrapper #gallery div img {
width:100px;
height:100px;
}
#list-wrapper #mainimg {
flex: 1 1 80%;
background-color:blue;
}
#list-wrapper #mainimg img {
width:100%;
height:auto;
}
Examples matching questions:


