title: HTML/CSS adjust parent div's height/width automatically according to children content
body: <p>I want to make this:
  <a href="https://i.stack.imgur.com/JZ9aA.png" rel="nofollow noreferrer">stacked cards</a></p>
  <p>the html would look like so:</p>
  <pre><code>&lt;div class=&quot;container&gt;
    &lt;div class=&quot;top-card&gt;
     &lt;div class=&quot;card-content&quot;&gt;
       ...
     &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;bottom-card&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>I am having trouble styling this so that the height of the entire card adjusts automatically according to the content inside the top card. Thank you in advance.</p>