title: Auto height of a div with image 100%
body: <p>I have following layout:</p>
  
  <p>CSS</p>
  
  <pre><code>.top-container{
  width:100%;
  height:auto;
  position:relative;
  }
  .top-container img{
  width:100%;
  height:100%;
  position:absolute;
  z-index:1;
  }
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;div class="top-container"&gt;
  &lt;img src="blahblah" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My problem is that i need the image to be width 100% (this is actually working),
  but the height must have an auto height because of the 100% width. I have tried with
  <code>height:auto</code>. But of course that did not help. It helped with a specific height, but then the image is scaled wrongly.</p>
  
  <p>Any suggestions?</p>