미니옵빠의 code stubs

background-size: cover polyfill 본문

Language/Polyfill

background-size: cover polyfill

미니옵빠 2015. 4. 8. 16:00

background-size: cover 속성은 IE8 이하에서 지원 안됨

참고: http://www.w3schools.com/cssref/css3_pr_background-size.asp


Polyfill

http://louisremi.github.io/background-size-polyfill/

https://github.com/louisremi/background-size-polyfill


같은 사람이 만든 jQuery 버전도 있는데 deprecated 되었음

https://github.com/louisremi/jquery.backgroundSize.js


참고


1.

However, this scales the entire image to fit in the allocated area. So if your using a sprite, this may cause issues.


http://stackoverflow.com/questions/4885145/ie-8-background-size-fix


2.

.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);
}