.boxGallery {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
margin-left: auto;
margin-right: auto;
width: 80%;
}
.gallery {
min-width: 320px;
width: 50%;
margin: 12px;
float: left;
}
.gallery img {
width: 100%;
height: auto;
padding: 5px;
border-radius: 12px;
}
.desc {
padding: 15px;
text-align: center;
}
<div class="boxGallery">
<div class="gallery">
<img src="https://placeimg.com/640/480/any">
</div>
<div class="gallery">
<img src="https://placeimg.com/640/480/any">
</div>
</div>
<div class="desc">
<p>Auvergne, Frankrijk 2018</p>
</div>
<div class="boxGallery">
<div class="gallery">
<img src="https://placeimg.com/640/480/any">
</div>
<div class="gallery">
<img src="https://placeimg.com/640/480/any">
</div>
</div>
I am trying to make a photo gallery. The thing is that I can't get the images to be next to eachother. So what I want is: I want a title above each section of photos, that section has to be centered and multiple images should be able to shit next to eachother accordingly to the size of the page. That last thing is what I can't get to work (screenshot). I don't really know how I can fix this. Anyone any ideas?