title: How can an <img> scale to the height of a sibling?
body: <p>The title is pretty self-descriptive. Just keep in mind that the container element is supposed to have its own width and height, as shown on the example. While this example is written in flexbox, I don't mind using other methods as long as it's pure, clean HTML/CSS.</p>
  <p>I feel like this should be trivial, but I've been looking for a while, including related answers on Stack Overflow, and I can't seem to find any satisfactory answer.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  img {
    margin-left: 8px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;div&gt;
      &lt;h1&gt;Lorem Ipsum&lt;/h1&gt;
      &lt;h2&gt;Dolor Sit Amet, here's some extra text&lt;/h2&gt;
    &lt;/div&gt;
    &lt;img src="https://via.placeholder.com/64" /&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>