I use a third-party component that occupies all the available space, i.e. width=100%
and height=100%
. I don't have control over it.
I'm trying to fit it in the following layout, but its height=100%
doesn't work (I expect the third-party component to occupy all the green space).
Why? How would you fix that?
.container {
display: flex;
flex-direction: column;
width: 200px;
height: 100px;
}
.header {
display: flex;
background-color: rgba(255, 0, 0, 0.5);
}
.content {
flex-grow: 1;
background-color: rgba(0, 255, 0, 0.5);
}
.third-party-component {
height: 100%;
width: 100%;
background-color: rgba(0, 0, 255, 0.5);
}
<div class="container">
<div class="header">Header</div>
<div class="content">
<div class="third-party-component">
Third party component
</div>
</div>
</div>
See Question&Answers more detail:os