CSS Image

css property to fit image in div

css property to fit image in div

CSS Image
The CSS object-fit property is used to specify how an or should be resized to fit its container. The CSS object-fit property is used to specify how an or should be resized to fit its container. Oject-fit property tells the content to fill the container in a variety of ways. These ares "preserve that aspect ratio" or "stretch up and take up as much space as possible". img {  width: 200px;  height: 400px;  object-fit: cover;}