Grow your CSS skills. Land your dream job.

Background-size and IE8

  • # August 28, 2012 at 1:50 pm

    I’m having issues getting background-size to work in IE8 – does anyone have any suggestions??

    http://internationaltowingmuseum.org/

    # August 28, 2012 at 1:56 pm

    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: http://css-tricks.com/perfect-full-page-background-image/

    # August 28, 2012 at 2:18 pm

    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…?

    # August 28, 2012 at 4:28 pm

    Yes, unfortunately they do slightly different things. Is there any particular reason why you’re using contain instead of cover?

    # August 28, 2012 at 4:40 pm

    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.

    # August 28, 2012 at 5:10 pm

    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?

    # August 28, 2012 at 5:27 pm

    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.

    # August 29, 2012 at 5:25 pm

    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.

    # August 29, 2012 at 5:50 pm

    Ok – found a workaround – not ideal, but it works:

    # December 6, 2012 at 9:41 am

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

    # August 24, 2014 at 3:13 am

    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

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".