When developing a web gallery, it can be usefull to maximize the image to the screen, so that

  • the proportions are preserved
  • the whole image fits the screen.

Here is a method for that, in pure HTML & CSS.

#imagewell {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
<div id="imagewell" style="background-image: url('http://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Grosser_Panda.JPG/300px-Grosser_Panda.JPG');">