Support 'background-size' property on older browsers?

前端 未结 6 1554
鱼传尺愫
鱼传尺愫 2020-12-16 23:06

Is there a way that I can use the CSS3 \'Background-Size\' property and then use something like Modernizr to ensure that it\'s supported in older browsers (in particular I w

6条回答
  •  攒了一身酷
    2020-12-17 00:00

    Another option would be Background Size Polyfill:

    .selector { 
        background-size: cover;
        /* The url is relative to the document, not to the css file! */
        /* Prefer absolute urls to avoid confusion. */
        -ms-behavior: url(/backgroundsize.min.htc);
    }
    

提交回复
热议问题