This kind of layout problem can be solved with flexbox now, avoiding the need to know heights or control layout with absolute positioning, or floats. OP's main question was how to get a parent to contain children of unknown height, and they wanted to do it within a certain layout. Setting height of the parent container to "fit-content" does this; using "display: flex" and "justify-content: space-between" produces the section/column layout I think the OP was trying to create.
<section id="foo">
<header>Foo</header>
<article>
<div class="main one"></div>
<div class="main two"></div>
</article>
</section>
<div style="clear:both">Clear won't do.</div>
<section id="bar">
<header>bar</header>
<article>
<div class="main one"></div><div></div>
<div class="main two"></div>
</article>
</section>
* { text-align: center; }
article {
height: fit-content ;
display: flex;
justify-content: space-between;
background: whitesmoke;
}
article div {
background: yellow;
margin:20px;
width: 30px;
height: 30px;
}
.one {
background: red;
}
.two {
background: blue;
}
I modified the OP's fiddle: http://jsfiddle.net/taL4s9fj/
css-tricks on flexbox: https://css-tricks.com/snippets/css/a-guide-to-flexbox/