A responsive two-column layout using flexbox
<p>I have a small layout of sections </p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>.collection {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
}
.collection section {
  width: 50%;
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="collection"&gt;
  &lt;section&gt;
    &lt;h2&gt;bar&lt;/h2&gt;
  &lt;/section&gt;

  &lt;section&gt;
    &lt;h3&gt;baz&lt;/h3&gt;
  &lt;/section&gt;

  &lt;section&gt;
    &lt;h1&gt;FOO&lt;/h1&gt;
  &lt;/section&gt;
&lt;/div&gt;</code></pre>
</div>
</div>
</p>

<p>Then everything is positioned in one column. I'd expect such a layout </p>

<pre><code>___________
| h2 |    |
|____| h1 |
|_h3_|____|
</code></pre>

<p>I know that the layout would wrap if I set <code>max-width</code>. But I don't know the <code>div</code> size in advance. My intent is to wrap in such a way that both columns have equal height.</p>

<p>How can I achieve it?</p>