title: How to scale an image with css to fill a div keeping aspect ratio?
body: <p>I'd like to fill a div with an <code>img</code>, keeping aspect ratio and stretching either width or height as much as required to fit in.</p>
  
  <pre><code>&lt;div style="width: 80px; height: 80px"&gt;
      &lt;img src="..." /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How could I achieve it? If the image is not quadratic, it must be "zoomed in" and either be scropped top-bottom or left-right, depending which side is the bigger one. Moreover the image should afterwards be centered, so that the corners get cut equally.</p>
  
  <p>I tried (but no effect):</p>
  
  <pre><code>.thumb {
      max-width:100%;
      max-height:100%;
  }
  </code></pre>
  
  <p>If I add additional <code>width: 100%; height:100%;</code>, the images fit perfectly, but are resized not keeping <code>aspect ratio</code>.</p>