Giorgio Vitanza Giorgio Vitanza - 5 months ago 10
CSS Question

One img aligned on the left, and one on the center, both vertically aligned, inside same div

I am struggling aligning 2 imgs in the same div. I want one to be aligned on the left, and the other to be in the center. Any suggestion?

Answer

div {
    background: red;
    text-align: center;
}
div img{
    vertical-align: middle;
}
.left {
   float:left;
}
<div>
    <img src="//placehold.it/50x50" class="left" />
    <img src="//placehold.it/50x50" />
</div>