What is the object-fit property in CSS?

What is the object-fit property in CSS?

Hi Rebecca,

The object-fit property in CSS controls how an image or video scales to fit its container element. Without object-fit , images might be stretched or squished to fill the container, distorting the aspect ratio.

Refer to this article to know how you can use it with real-life examples: