The object-fit property will defines how an element will fit into a box with an established height and width. Usually applied to an image or video, Object-fit accepts the following five values:

FILL

object-fit:fill;

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b0042e1c-2f91-4b9d-8d8e-604721e9318a/Untitled.png

Fill stretches the image to fit the content box without regard to the image’s original aspect ratio.

CONTAIN

object-fit:contain;

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/ed60055e-4642-4ab5-96a9-88df43ae0dea/Untitled.png

Contain fits the image in the box’s height or width while maintaining the image’s aspect ratio.

COVER

object-fit:cover;

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b5fa106b-c16b-463f-8887-8cda9d89d084/Untitled.png

Cover fills the entire box with the image. The image aspect ratio is preserved, but the image is cropped to the dimensions of the box.

NONE

object-fit:none;

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/6a0becfb-765b-404c-99fc-2d4b6d59b508/Untitled.png