I'm using max-width:100%; and max-height:100%; for my img tag. There's a container around the img, and for some reason extra whitespace appears next to the image, on the right.
The container's width is not fixed, so it should be the same, like the image + 15px padding on every side.
CSS
*, *:before, *:after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
ul {
list-style:none;
margin:0;
padding:0;
}
li {
height:100px;
display: inline-block;
background: lightblue;
padding: 15px;
}
img {
max-width:100%;
max-height:100%;
}
HTML
<ul>
<li><img src="http://lorempixel.com/1450/600/"></li>
</ul>
Codepen: http://codepen.io/anon/pen/mJJqzo