Polyfill for object-fit: cover

1
2
if('objectFit' in document.documentElement.style === false) {
var container = document.getElementsByClassName('js-box');
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Thanks to https://pawelgrzybek.com/image-tag-vs-background-property/ (check this website for explanation)

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.