In this moment, the image in the div element uses flex, and some CSS to sale them into a box of some sort. Meanwhile the problem seem to be when I want to center the images to the center of the CSS box.
I tried to do it with text-align: center
and also with margins, but that makes the anchor elements closer to one another. What I want is to keep the distance between the a links while the images are centered to to center of the box.
What i see right now:
as you see in the last two boxes the images are aligned to the top left, and not to the center.
What i want to achieve (dots are the image):
.image-list {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
margin-left: auto;
margin-right: auto;
align-items: center;
margin-top: 20px;
padding-left: 80px;
}
.image-list img {
width: 50px;
height: 50px;
margin-right: 10px;
margin-bottom: 10px;
object-fit: contain;
justify-content: center;
}
<div class="image-list">
<a href=""><img src="https://via.placeholder.com/80" alt=""></a>
<a href=""><img src="https://via.placeholder.com/80" alt=""></a>
<a href=""><img src="https://via.placeholder.com/80" alt=""></a>
<a href=""><img src="https://via.placeholder.com/80" alt=""></a>
<a href=""><img src="https://via.placeholder.com/80" alt=""></a>
<a href=""><img src="https://via.placeholder.com/80" alt=""></a>
</div>