title: How to cover a div with an img tag (like background-image does)?
body: <p>As discussed <a href="https://stackoverflow.com/questions/14142378/css-filling-a-div-with-an-image-while-staying-in-proportion">here</a> I am trying to get an image to be covered within a div. With just these simple lines I was able to achieve this via <code>background-image</code>:</p>
  
  <pre><code>div{
      width: 172px;
      height: 172px;
      border-style: solid;
      background-image: url('../images/img1.jpg');
      background-size: cover;
      background-repeat: no-repeat;
      background-position: center;
  }
  </code></pre>
  
  <p>In result the image was centered within the div and was resized so it would fit the width or the height of the div (depending if the image was wide or not).
  Now I would like to achieve the same result with the image tag within the div.</p>
  
  <pre><code>&lt;div&gt;
    &lt;img src="images/img1.jpg"/&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Is there any way to get through this with plain CSS?</p>