css3 — img object-fit:container
1 min readJun 18, 2019
css3 img object-fit property
- the aspect ratio of the images is preserved:
img{object-fit: cover;}
Look at this image! I just resize the browser. but the image’s aspect ratio is there!
- object-fit:fit
img{object-fit: fit;}
look at the left image. its original aspect ratio is destroyed and the only left image is squeezed to fit the container.
#ref