{"id":194850,"date":"2015-02-02T04:01:46","date_gmt":"2015-02-02T11:01:46","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=194850"},"modified":"2020-07-01T12:54:02","modified_gmt":"2020-07-01T19:54:02","slug":"object-fit","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/o\/object-fit\/","title":{"rendered":"object-fit"},"content":{"rendered":"

The object-fit<\/code> property defines how an element responds to the height and width of its content box. It’s intended for images, videos and other embeddable media formats in conjunction with the object-position<\/a><\/code> property. Used by itself, object-fit<\/code> lets us crop an inline image by giving us fine-grained control over how it squishes and stretches inside its box.<\/p>\n

object-fit<\/code> can be set with one of these five values:<\/p>\n