crop image to fit in a div box? crop image to fit in a div box? jason.lex (Vendor) (OP) 11 Jan 19 05:51 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/ RE: crop image to fit in a div box? feherke (Programmer) 11 Jan 19 10:06 Hi Quote (Sizing Objects: the object-fit property)The object-fit property specifies how the contents of a replaced element should be fitted to the box established by its used height and width.( 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? jason.lex (Vendor) (OP) 11 Jan 19 11:25 Ah Ok. I see how this is applied now. Thanks for the help again.