I have 4 pictures that I wish to align, the issue I have is that they are not in the same div and I cannot find a responsive solution.
Depending on the size of the screen, the text may take up to 3 lines and I would like for all of the logos to adapt simultaneously even if their own text does not have as many lines.
This is what I currently have :
The logos are what I would like to align.
This is the HTML :
<div class="container">
<div class="row">
<div class="col-sm-3">
<div class="buffer"></div>
<p class="text-center">Mon LinkedIn</p>
<a class="image-link" href="link1">
<img class="image-link img-size" src="assets/img/contact/LinkedIn-Logo.png">
</a>
</div>
<div class="col-sm-3">
<div class="buffer"></div>
<p class="text-center">Mon profil Malt</p>
<a class="image-link" href="link2">
<img class="image-link img-size" src="assets/img/contact/logoMalt.png">
</a>
</div>
<div class="col-sm-3">
<div class="buffer"></div>
<p class="text-center">Mes projets open source</p>
<a class="image-link" href="link3">
<img class="image-link img-size" src="assets/img/contact/so-logo.png">
</a>
</div>
<div class="col-sm-3">
<div class="buffer"></div>
<p class="text-center">Mes contributions open source</p>
<a class="image-link" href="link4">
<img class="image-link img-size" src="assets/img/contact/GitHub_Logo.png">
</a>
</div>
</div>
</div>
And this is the CSS :
.image-link {
display: block;
margin-left: auto;
margin-right: auto;
}
.img-size {
max-width: 100px;
max-height: 20px;
}
.buffer {
padding-top: 40px;
}
I did try to put the text and the logos in different rows but even though it yields a good result on big screens, it does not on small screens ( the text gets separated of the logo )
for that), above your image, to be constant on your four divs
– Ostn Jun 28 '20 at 19:04