title: Fit an img in a non fixed dimension container
body: <p>I've got issues because I can't "auto-resize" an img in the div where I've put it, I'm doing this and it doesn't work:</p>
  
  <pre><code>#slider img{
  position:relative; 
  border:none;
  display:none;
  height: 100%; width: 100%;}
  
  #slider { 
  background:#fff url(loading.gif) no-repeat 50% 50%;
  margin-left: 10%;
  margin-right: 15%;
  position:absolute;
   width:75%;height:50%;
  transform: translate3d(0,0,0);
  box-shadow: 0px 1px 5px #999999;}
  
   &lt;div id="slider"&gt;
  
        &lt;img src="SAM_3142.JPG"border=0 /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So I want the img to fit perfectly in this div regardless of the div's dimensions, do you know how to do so please?</p>