1img {
2 display: block;
3 max-width: 100%;
4 max-height: 100%;
5 width: auto;
6 height: auto;
7}
1/* Simply add width without height,
2aspect ratio will be maintained
3and height will be calculated accordingly*/
4
5img {
6 width: 100px;
7}
1.image-full {
2 background: url(...some image...) no-repeat;
3 background-size: cover;
4 background-position: center center;
5}
6