Flexbox has this behaviour where it stretches images to their natural height. In other words, if I have a flexbox container with a child image, and I resize the width of that image, the height doesn't resize at all and the image gets stretched.
What causes this?
I added This CodePen to demonstrate what I mean.
It is stretching because align-self
default value is stretch
.
Set align-self
to center
.
align-self: center;
See documentation here: align-self