I know that when you use a percent height on an element, the percentage is the percent of it's parent. Let's say that you want a child to be 40% of it's parent. The parent has a max and a min height assigned, but it does not have an explicit height assigned. For example:
<div id="container">
<div id="one">
<div id="two"></div>
</div>
</div>
css
#container{
height: 500px;
background: yellow;
}
#one{
background: red;
min-height:100px;
max-height: 50%;
padding: 10px;
}
#two{
background: blue;
height: 40%;
}
Div two will not appear. When you change the css of his parent (div one) from this max-height:50%
to this: height:50%
div two will appear because it knows what the height of his parent is because it is explicitly defined. My question is there a way to make div two appear while using (min/max)-height
and not height
Here is a fiddle