title: CSS Image auto width and height
body: <p>I have a div which has image inside it. I want the image to have maximum height or width as the div but not exceed it. <a href="http://jsfiddle.net/766ewje6/" rel="nofollow">Fiddle - Something like this</a></p>
  
  <pre><code>div.gcontainer{
      position: fixed;
      margin: 0;
      padding: 0;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
  }
  div.gcontainer img{
      position:relative;
      max-width:100%;
      max-height:100%;
  }
  </code></pre>
  
  <p>Not getting it. What should I do?</p>