- This topic is empty.
Viewing 11 posts - 1 through 11 (of 11 total)
Viewing 11 posts - 1 through 11 (of 11 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I’m having issues getting background-size to work in IE8 – does anyone have any suggestions??
http://internationaltowingmuseum.org/
background-size is not available to IE8: http://caniuse.com/#feat=background-img-opts
If you’re trying to use background-size: cover, check out this post: https://css-tricks.com/perfect-full-page-background-image/
Yup – already checked out that page and I couldn’t get it to work. I’m thinking probably because I’m trying to do background-size:contain and not cover…?
Yes, unfortunately they do slightly different things. Is there any particular reason why you’re using contain instead of cover?
Honestly – because cover didn’t give the right effect and I’m stuck using that image for the background – my client was veeeeery insistent on that.
That’s a tough call, then. I’m not sure if there’s a solution for you. Perhaps for IE8 and lower you can go with a cover method?
It looked reaaally bad with cover… so I’m thinking that won’t work. Hmmmm… surely there has to be a way… javascript, jquery, something. The first VP of the museum uses IE8 and won’t upgrade – so I don’t have a choice but to make it work. I don’t have to go any older than IE 8 though.
Anybody have any suggestions at all for this one? I’m open to anything that works in IE8 and still has a similar look to what I have now.
Ok – found a workaround – not ideal, but it works:
I have created a [background-size polyfill](https://github.com/louisremi/background-size-polyfill “background-size polyfill”) for IE8 that is really simple to use:
.selector {
background-size: cover;
-ms-behavior: url(/backgroundsize.min.htc);
}
I created background-size-emu pure JS library that adds support of background-size to ie6, ie7, ie8 and ie9 in quirks mode.
It’s free and you can find it here: https://github.com/Metafalica/background-size-emu