.boxInner { position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px; overflow: hidden; border: 1px solid; border-color: rgb($BORDERRED$, $BORDERGREEN$, $BORDERBLUE$) } .boxInner img { display: block; width: 100%; position: absolute; margin: auto; }