title: Fit image with height 100% in flex
body: <p>I have a responsive background image in a div. And i want a two column flex layout on top of it, in which the left layout have image of height 100% of the parent div with width auto scale like responsive image. and the right part is a two line text centering in the flex.</p>
  
  <p>This is the closest i can get so far. But the flex does not stretch to fit the background div image and the left image does not scale accordingly when browser resize.</p>
  
  <p><strong>Note: None of the width and height in px should be specified in the code</strong></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>.parent {
    display: flex;
    align-items: center;
  }
  
  .left {
    height: 100%;
  }
  
  .right {
    flex: 1;
    background: blue;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>  &lt;div style="position: relative;"&gt;
      &lt;img src="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTkyfCkzwQ7Lx4v3YRNao0lQgM-VkEj6iLWTHE8KqHF5tk4cl15WQ" style="width: 100%"&gt;
      &lt;div style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;"&gt;
        &lt;div class="parent"&gt;
          &lt;div class="left"&gt;
            &lt;img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRsxhzGxiYQU_vp2YlN1LTMxQsYMhFDqTZLwfqMylCwqIahCu00Mf_0aDQ"&gt;
          &lt;/div&gt;
          &lt;div class="right"&gt;
            &lt;p&gt;
              123
            &lt;/p&gt;
            &lt;p&gt;
              456
            &lt;/p&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Expectation: 
  <a href="https://i.stack.imgur.com/JPykl.png" rel="nofollow"><img src="https://i.stack.imgur.com/JPykl.png" alt="enter image description here"></a></p>