My problem is I want 2 columns with same height, and I used for this display: flex in container. One of this columns has a child, and I want this child have percentage of parents, but it inherit the percentage from the body.
This is my example code:
<style>
.container {
display: flex;
}
.container > div {
float: left;
width: 200px;
}
.parent1 {
border: solid 1px red;
}
.parent2 {
border: solid 1px blue;
}
.child {
background-color: yellow;
height: 100%; /*the problem is here, the div inherit the height of the body*/
}
</style>
<div class="container">
<div class="parent1">
dynamic test
<br />dynamic test
<br />dynamic test
<br />dynamic test
<br />dynamic test
</div>
<div class="parent2">
<div class="child">
child
</div>
</div>
</div>