
The CSS object-fit property is used to specify how an <img> or <video> should be resized to fit its container.
This property can take one of the following values:
fill – This is default. Does not preserve the aspect ratio. The image is resized to fill the container (the image will be stretched or squeezed to fit).cover – Preserves the aspect ratio, and the image fills the container. Cuts overflowing content if needed.contain – Preserves the aspect ratio, and fits the image inside the container, without cutting – leaves empty space if needed.none – The image is not resized.scale-down – the image is scaled down to the smallest version of none or contain.