I have the following code:
.parent {
height: 150px;
display: flex;
flex-direction: column;
background: salmon;
border: 2px solid black;
}
.child1 {
background: red;
}
.child2 {
background: grey;
height: 100%;
display: flex;
}
.grandchild2 {
height: 100%;
background: pink;
border: 2px solid blue;
}
.mybutton {
height: 100%;
width: 100%;
background: purple;
}
<div class="parent">
<div class="child1">
child 1
</div>
<div class="child2">
<button class="mybutton">
<div class="grandchild2">
I'm inside a button
</div>
</button>
</div>
</div>
My goal is to make grandchild2
fill the button. However, in Safari 12.1.1, grandchild2
becomes bigger than the button probably thinking that its parent is parent
.
Any workaround ?
See this.
In Chrome and Firefox, grandchild2
fills the button correctly.