title: Why does flexbox stretch my image rather than retaining aspect ratio?
body: <p>Flexbox has this behaviour where it stretches images to their natural height. In other words, if I have a flexbox container with a child image, and I resize the width of that image, the height doesn't resize at all and the image gets stretched.</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>div {
    display: flex; 
    flex-wrap: wrap;
  }
  
  img {
    width: 50%
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;
      &lt;img src="https://i.imgur.com/KAthy7g.jpg" &gt;
      &lt;h1&gt;Heading&lt;/h1&gt;
      &lt;p&gt;Paragraph&lt;/p&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>What causes this?</p>