Scale images with CSS to fit inside layout
Scale images with CSS to fit inside layout

Using some code found at https://stackoverflow.com/questions/14425300/scale-image-properly-but-fit-inside-div

The original snippet was

    html, body { height: 100%; }
    #gallery { height: 100%; width: 100%; position: relative; }

    #gallery img {
      /* CSS Hack will make it width 100% and height 100% */
      position: absolute;
      top: 0px;
      right: 0px;
      bottom: 0px;
      left: 0px;
      /* Maintain aspect ratio */
      max-height: 100%;
      max-width: 100%;
    }

Looks like we don't need to two first lines at all (maybe we already do
something similar) and when I removed "position: absolute;" it started
to behave reasonable.

Starkast/wikimum,Starkast/wikimum