Let your image use its space properly

Let your image use its space properly

ยท

1 min read

So i was embedding an image on the website and it was losing its shape even after setting properties like width and height So how i fixed this issue in Css?

Even though we set an image its width and height property, the image may go out of shape

So inorder to avoid this issue we need to make sure our image uses its space properly on the website

To make your image cover its container box you need to use "object-fit" property to value like "Cover" so that it covers its allocated container box

For eg: Img{ width: 100px; height: 200px Object-fit: Cover; }

And your issue is solved!! Your image will use the space comfortably ๐Ÿ˜Œ

ย