I encountered an issue with a code snippet involving a flex
div containing an img
:
html, body {
height: 100%;
margin: 0;
}
.container {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
background: black;
}
.item {
max-height: 100%;
max-width: 100%;
}
<div class="container">
<img src="https://i.sstatic.net/aHBI2.png" class="item">
</div>
While resizing the window vertically in Chrome and IE, I noticed that the image was only responsive in the vertical direction. The width did not adjust proportionally to the decreasing height. However, this problem did not occur in Firefox.
Have you come across this issue before?