title: Keep image in ratio and not allow to expand outside of container
body: <p>Feel like I have explored every option on this and without resulting in a lot of javascript work I wanted to see if there was another way around this.</p>
  
  <p>I have a main container that is 100vh and fixed. The aim for this client is to not allow any scrolling. Inside this container I have a number of image layouts, the images need to remain the same ratio and sizing no matter what width / height the browser.</p>
  
  <p>Here is 2 example layouts, the black boxes being images:</p>
  
  <p><a href="https://i.stack.imgur.com/DqDO1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DqDO1.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/XGXbD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XGXbD.png" alt="enter image description here"></a></p>
  
  <p>I thought it was simple at first, just give the images a width percentage and they will be responsive however they also need to respond to the height.</p>
  
  <p>An example site is here: <a href="http://geordiewood.com/projects/meetka/2" rel="nofollow noreferrer">http://geordiewood.com/projects/meetka/2</a></p>
  
  <p>If you resize the browser you can see the images remaining in ratio to the broswer spacing around them etc. Inspecting the elements I can see they have dynamicly adjusting heights and width but im looking for a purely css way if possible?</p>
  
  <p>Example html markup:</p>
  
  <pre><code>&lt;div class="layout"&gt;
      &lt;div class="image-wrapper"&gt;
          &lt;img src="img1.png/&gt;&lt;img src="img1.png/&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>