object-fit

The object-fit property controls the aspect ratio of replaced elements such as img and video when they are given a width or height, and how they are scaled. The object-fit property can maintain the element's original proportions, or vice versa, distort the proportions to fit the dimensions.

Syntax



object-fit: fill | contain | cover | none;