I have this code here and it behaves differently in Safari than in Chrome and Firefox, why?
.parent {
height: 150px;
display: flex;
flex-direction: column;
background: salmon;
border: 2px solid black;
}
.child1 {
background: red;
}
.child2 {
background: grey;
height: 100%;
}
.grandchild2 {
height: 100%;
background: blue;
}
<div class="parent">
<div class="child1">
child 1
</div>
<div class="child2">
<div class="grandchild2">
</div>
</div>
</div>
I don't understand why the presence of grandchild2
makes child2
to have the same height as parent
. Is this a known Safari bug?
If I remove grandchild2
, child2
doesn't overflow.
Is there a workaround to make Safari behave like Chrome and Firefox?