crop image to fit in a div box?
crop image to fit in a div box?
(OP)
Hi,
I am trying to fit an image to a div using object-fit but it doesn't seem to work? I am trying to do what is shown here: https://www.w3schools.com/css/css3_object-fit.asp
https://jsfiddle.net/mh7yLvtj/
I am trying to fit an image to a div using object-fit but it doesn't seem to work? I am trying to do what is shown here: https://www.w3schools.com/css/css3_object-fit.asp
https://jsfiddle.net/mh7yLvtj/
RE: crop image to fit in a div box?
( CSS Images Module Level 4 | 5. Sizing Images and Objects in CSS | 5.1. Sizing Objects: the object-fit property )
As I understand, if you not specify a different width and/or height for the image, no fitting theory is applied.
https://jsfiddle.net/mh7yLvtj/1/
Feherke.
feherke.github.io
RE: crop image to fit in a div box?
I see how this is applied now. Thanks for the help again.