-1

I am looking into background-size for a couple of reasons, but mainly because by using it I can use sprites and I can make those images responsive. The problem, of course, is older browsers such as IE8 and lower.

I wish I could use a polyfill but this one does not seem to work with numeric values, only with cover and contain. What I need is a decent fallback for things like this:

background-size: 100% auto;

I'd rather not use any plugins, unless there is no other way.

Bram Vanroy
  • 27,032
  • 24
  • 137
  • 239

1 Answers1

2

Take a look at Louis Remi's Polyfil. I usually use backstretch.js for this problem. At a point you just have to stoping caring about accuracy in IE8.

Elise Chant
  • 5,048
  • 3
  • 29
  • 36
  • @BramVanroy The rational solution in your instance is to review your Spriting and responsive images implementation. – Elise Chant Jan 04 '14 at 23:12
  • 2
    @BramVanroy you need to use nested elements in this context and append and position the Sprite on the child element inside of its' parent. This is commonplace is all the frameworks, look at how [Inuit handles sprites](https://github.com/csswizardry/inuit.css/blob/master/objects/_sprite.scss) for example. ` View your favourites ` I've also had similar battles with background-size in the past and unfortuanately I don't have an explicit answer to your original question, but at least an alternate definition of your problem space. – Elise Chant Jan 05 '14 at 00:48