What does object-fit property do?

Aneeqa Khan
Sep 12, 2022

--

Last time I wrote about the topic of responsive images and object-fit plays a vital role in displaying images.

Usually, during displaying user-uploaded images we face the issue of image replacement according to the UI.

For example, if you want to show a rectangle image in a square box, it will be shown as a stretched image in a browser.

To fix this kind of issue, object-fit CSS property is beneficial.

I have created a simple app to demonstrate object-fit property usage and benefits.

Thank you for reading!
Feel free to connect on Twitter

--

--

Aneeqa Khan
Aneeqa Khan

Written by Aneeqa Khan

I’m a frontend web and mobile developer specialized in web/mobile designs and frontend frameworks. I usually work with React, React Native, Next and TypeScript.

No responses yet