objectFit

The objectFit sets how the content of an element should be resized to fit its container.

contain:

The content is scaled to maintain its aspect ratio while fitting within the element's content box. The entire object is made to fill the box, while preserving its aspect ratio, so the object will be "letterboxed" or "pillarboxed" if its aspect ratio does not match the aspect ratio of the box.

cover:

The content is sized to maintain its aspect ratio while filling the element's entire content box. If the object's aspect ratio does not match the aspect ratio of its box, then the object will be clipped to fit.

none:

The content is not resized.

Enumeration Members

CONTAIN: "contain"
COVER: "cover"
NONE: "none"