title: Image flex item does not shrink height in a flexbox
body: <p>I have a flex container which contains an <code>img</code> flex item.</p>
  
  <p>I want this <code>img</code> to disregard its intrinsic height (90px) so that the height may shrink to match the sibling's flex item height (as per the default <code>align-items: stretch</code> style).</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.container {
      border: 1px solid;
      display: flex;
  }
  
  .item {
      border: 1px solid;
  }
  
  .content {
      width: 200px;
      height: 50px;
      background-color: hotPink;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
      &lt;img class="item" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRu-3yBSd2b6JCOMcGVSOFf8X49QB3Ik-OI87gKEMwWLrdJxP5qOErmZQ"&gt;
      &lt;div class="item"&gt;
          &lt;div class="content"&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>We can see the desired behaviour if we swap the <code>img</code> for a <code>div</code>:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.container {
      border: 1px solid;
      display: flex;
  }
  
  .item {
      border: 1px solid;
  }
  
  .dynamicHeightContent {
      width: 120px;
      height: 100%;
      background-color: green;
  }
  
  .content {
      width: 200px;
      height: 50px;
      background-color: hotPink;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
      &lt;div class="item"&gt;
          &lt;div class="dynamicHeightContent"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="item"&gt;
          &lt;div class="content"&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I have tried <code>min-height: 0</code> on the <code>img</code>, to no avail.</p>
  
  <ul>
  <li>What is the special behaviour that applies to <code>img</code> but not <code>div</code>?</li>
  <li>How can we opt out of <code>img</code>'s special behaviour so that it behaves like other flex items (such as <code>div</code>)? If there isn't a way to opt-out, is there a recommended workaround?</li>
  </ul>
  
  <p>Note that whilst the <code>img</code> won't shrink its height, it does appear to <em>grow</em>:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.container {
      border: 1px solid;
      display: flex;
  }
  
  .item {
      border: 1px solid;
  }
  
  .content {
      width: 200px;
      height: 300px;
      background-color: hotPink;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
      &lt;img class="item" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRu-3yBSd2b6JCOMcGVSOFf8X49QB3Ik-OI87gKEMwWLrdJxP5qOErmZQ"&gt;
      &lt;div class="item"&gt;
          &lt;div class="content"&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Note: I'm happy to disregard the <code>img</code>'s aspect ratio. I plan to avoid skewing the <code>img</code> via <code>object-fit: cover</code>.</p>