The object-fit CSS property sets how the content of a replaced element, such as an or , should be resized to fit its container.
MDN Reference