Does anyone know what I am missing to vertically align a img inside a div?
I have some sass, though I can work with plain CSS too.
I thought text-align
was sufficient ? But it isn't working. The margin and height are automatically set on the <img>
so G know that is working.
.testdiv {
font-size: rem(12);
height: 80px;
img {
margin-left: 12px;
height: 16px;
width: 16px;
text-align: center;
}
}
and some html
<div class="testdiv">
<img src="./test.png">
</div>