Reputation: 109
I have an image within a flex container.
The image stays at its original height in Chrome and will not resize proportionally. It works in Firefox however.
<figure>
<img src="image.jpg">
<a href="#">A link to somewhere</a>
</figure>
figure {
display: flex;
width: 100%;
}
figure img {
max-width: 50%;
height: auto;
}
Upvotes: 0
Views: 576
Reputation: 2049
Flex makes its children equal in height by default. To disable this behavior, you can specify align-items: flex-start
.
https://jsfiddle.net/3s2hLv92/1/
Upvotes: 1