make image maintain original ratio css code example
Example 1: preserve aspect ratio image css
/* Simply add width without height,
aspect ratio will be maintained
and height will be calculated accordingly*/
img {
width: 100px;
}
Example 2: css keep aspect ratio image
.image-full {
background: url(...some image...) no-repeat;
background-size: cover;
background-position: center center;
}