How can I increase the height of the parent element which has relative position based on child elements height which has absolute position.
In my below example height of the .parent element is showing as 0px
PS: I do not want to use any script
Expected:
What I am getting:
HTML:
<div class="parent">
<div class="child" style="top:20px;">Hello</div>
<div class="child" style="top:40px;">Some content</div>
<div class="child" style="top:60px;">Some more content</div>
</div>
CSS:
.parent{position:relative;background:green;height:100%;border:1px solid #000000;width:250px;}
.child{position:absolute;}


