loading...

re: Share your CSS knowledge VIEW POST

TOP OF THREAD FULL DISCUSSION
re: object-fit is one I haven't used too much until recently (due to browser support). Once you can finally get off that IE11 train the web world reall...
 

My favorite thing about object-fit is that you can use it with img srcset for responsive background images! The picture element is cool if you really need to be serving differently cropped images, but whenever I can get away with same aspect ratio and not supporting IE, I always use object-fit + srcset for all background images.

 

Definitely a good use case! Did this myself in a recent project in fact.

Code of Conduct Report abuse