I am trying to build a masonry layout that wraps vertically but it isn't working. I don't know if it's because the size of the images or flexbox isn't built for this.
This is my CSS Code
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
.container {
max-width: 960px;
height: 80vh;
margin: 0 auto;
display: flex;
flex-direction: column;
flex-wrap: wrap;
column-gap: 0;
}
div {
width: 33.3%;
}
img {
width: 100%;
}
This is my HTML:
<section class="container">
<div>
<img src="warsaw.jpg" alt="">
</div>
<div>
<img src="old%20town%20warsaw.jpg" alt="">
</div>
<div>
<img src="Krakow-Wawel-Castle.jpg" alt="">
</div>
<div>
<img src="warsaw.jpg" alt="">
</div>
<div>
<img src="Krakow-Wawel-Castle.jpg" alt="">
</div>
<div>
<img src="old%20town%20warsaw.jpg" alt="">
</div>
</section>