CSS 'background-size' property - Cross-Browser Solution? -
i have element uses css:
.my-box { padding-left:50px; background-image:url('images/img01.png'); background-size:20px; height:20px; }
my problem: in browsers internet explorer, 'background-size' property doesn't work. there solution either through javascript, jquery or css make work without having put physical <img> tag in markup?
you can use polyfill. maybe fill issue. ie behavior adding support background-size: cover; , background-size: contain; ie8.
how use it?
everywhere use background-size: cover; or background-size: contain; in css, add reference file. backgroundsize.min.htc
.selector { background-size: cover; /* url relative document, not css file! */ /* prefer absolute urls avoid confusion. */ -ms-behavior: url(/backgroundsize.min.htc); }
see here: background-size polyfill github repo , further information
Comments
Post a Comment