louisremi / background-size-polyfill

Adds support for background-size "cover" and "contain" to IE8
http://louisremi.github.com/background-size-polyfill/
MIT License
1.26k stars 359 forks source link

IE8: Original image below resized image #35

Closed Awem closed 10 years ago

Awem commented 10 years ago

In my LESS-File (Joomla/Gantry4) I use BSP like this:

body #rt-logo {
    background: url(/images/logos/Logo.png) 50% 0 no-repeat !important;
    height: 150px;
    width: 150px;
    background-size: contain !important;
    -ms-behavior: url(/backgroundsize.min.htc);
}

In IE8 I can see the properly sized logo, but underneath it I can see the original logo, because the PNG file has transparent parts.

jefferyto commented 10 years ago

Is the original logo still visible if you remove !important from your background declaration?

Awem commented 10 years ago

Yes, removing !important fixes the issue. Is this the intended behavior?

jefferyto commented 10 years ago

It was, but I think I've found a way (after forgetting it earlier) to override !important styles. I'll see if I have time to work on this soon.

Awem commented 10 years ago

Your patch fixes the issue. Thanks a lot!

jefferyto commented 10 years ago

Great - thanks!