So I thought I can't set height in % if the parent doesn't have set height even if one of the children have a static height and is stretching the parent, but now I realized that if the child is position absolute it can. Why can a position absolute child have % height, but a block, inline or float child can't? http://jsfiddle.net/4vmeqf16/
body > div{
background: black;
}
div div:nth-child(1){
width: 50px;
height: 50px;
background: red;
}
div div:nth-child(2){
width: 20%;
height: 20%;
background: green;
}
div div:nth-child(3){
width: 20%;
height: 20%;
position: absolute;
background: yellow;
}
<div>
<div></div>
<div></div>
<div></div>
</div>