below is the code which works on chrome and firefox in which the img respects the parent height and fits into it but in safari, the image overflows.
I can fix this by adding overflow: hidden or removing the flex-basis.
can someone share info on it?
also, it's 2023 and flexbox is almost stable. Is this bug in safari?
.parent {
display: flex;
flex-direction: column;
height: 200px;
overflow: hidden;
border: 1px solid red;
}
.child {
display: flex;
flex-basis: 0;
height: 100%;
}
.innerChild {
height: 100%;
}
img {
max-height: 100%;
}
<div class="parent">
<div class="child">
<div class="innerChild">
<img src="https://picsum.photos/id/237/200/600"/>
</div>
</div>
</div>
safari snapshot
chrome snapshot