title: Maintain container height of dynamic content
body: <p>I have a container with content. The container's <code>width</code> is fixed but its height is determined by its inner content.</p>
  <p>Initially, the content of the container causes the container to be a particular height. I then want to shrink the inner elements content while maintaining the original height of the container.</p>
  <p>In the snippet below, my goal is to maintain the initial height of the red box while still shrinking the font-size of the inner content.</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-js lang-js prettyprint-override"><code>function changeSize() {
    document.querySelector('.box').classList.add('active');
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.container {
    border: 1px solid red;
    width: 30%;
  }
  
  .box {
    background: lime;
    transition: font-size 1s linear;
  }
  
  .box.active {
    font-size: 5px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
    &lt;p class="box"&gt;This is some text which changes size and causes the container to change height.&lt;/p&gt;
  &lt;/div&gt;
  
  &lt;button onclick="changeSize()"&gt;Change text size&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>At the moment, the red-box shrinks with the inner content, whereas I want it to remain at its initial height.</p>
  <p>I know I can give the container (ie: red box) a fixed height, but I want its height to be determined by the initial height of its inner contents.</p>
  <p>Is there anyway to use CSS to maintain the initial height of the container while also being able to change the size of the child element? I tried adding a wrapper element to the content but wasn't too sure where to go from there.</p>