object-fit: contain code example
Example 1: css image cover
object-fit: contain;
Example 2: onbject-fit css
The object-fit CSS property sets how the content of a replaced element, such as an <img> or <video>, should be resized to fit its container.
Example 3: object fit cover
img {
width: 200px;
height:
400px;
object-fit: cover;
}