My Problem
I'm trying to make a photo gallery with a title underneath it for each image. But the issue I am encountering is that the title keeps floating next to the image. For Reference see this screenshot.
CSS Snippet
@media only screen and (max-width: 600px) {
.boxGallery {
margin-left: 50%;
margin-right: 50;
}
}
.GalleryBox {
display: block;
padding-left: 100px;
padding-right: 100px;
width: 100%;
}
.boxGallery {
display: block;
margin-left: auto;
margin-right: auto;
width: 80%;
}
div.gallery {
margin: 5px;
float: left;
width: 250px;
}
div.gallery img {
width: 250px;
height: 190px;
}
div.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>
Any help on how to fix this please.