CodePen

HTML

            
              <div class="container">
  <img  src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d4/Tringa_glareola_-_Laem_Phak_Bia.jpg/640px-Tringa_glareola_-_Laem_Phak_Bia.jpg"/>
</div>

            
          
!
via HTML Inspector

CSS

            
              html,body {
 width: 100%;
 height: 100%;
  padding:0;
  margin:0;
}

.container {
  width: 100%;
  height: 100%;
  background: #EEE;
  min-height: 250px;
  position: relative;
}

img {
  max-height: 100%;
  max-width: 100%;
  height: auto;
  width: auto;
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  box-sizing: border-box;
  margin: auto;
}
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              
            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................