Looking to stack two divs on top of each other within a parent div to create a tab system for an applet. The challenge is that the parent div has auto height and the exact height of the child divs is unknown. Absolute positioning allows me to stack the divs, but the auto height doesn't adjust as expected, resulting in an empty border line instead of wrapping the elements.
To see the issue in action: http://jsfiddle.net/h5bjt69s/
<div id = "parent">
<div id = "redDiv"></div>
<div class = "clearfix"></div>
<div id = "blueDiv"></div>
</div>
Attempted to solve it based on this reference, but the auto height complicates things. Position absolute but relative to parent
How can I wrap the two divs with the parent div while maintaining their stack order?