Here is an example code snippet:
<div id="parent">
<div id="top">
</div>
<div id="mid">
</div>
</div>
I am looking to position the green div below the yellow one, with its height always adjusting to fill the parent div accurately. For instance, if the parent's height is 300 and the yellow div's height is 100, then the green div should be 200 in height. Similarly, if the parent's height is 350 and the yellow div's height is 50, then the green div should be 300 in height.
I want this functionality to work even if the heights of the yellow or green divs are changed dynamically during runtime using JavaScript. Is it possible to achieve this effect purely with CSS?
Thank you.