3

I'm hunting for a solution that provides IE6 - IE8 support for the following:

background-size: 10em 10em;

This would allow one to have dynamic sizing control over background images.

I'm okay with virtually any solution (HTC, JavaScript, CSS Hacks, etc.).

I do not want to stretch the background image across the entire container. This can already be done with -vendor-background-size (using the cover value) and MS specific filters (IE6-8).

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
w0lf42
  • 508
  • 6
  • 19
  • Dunno if you have found your solution, but this one http://stackoverflow.com/questions/2991623/make-background-size-work-in-ie did it all for me. – darksoulsong Nov 06 '12 at 15:38
  • 2
    Version 2 of [CSS3Pie](http://css3pie.com/) says it adds support for `background-size` to IE6-8. I haven't tried that specific feature yet, but the rest of CSS3Pie is pretty good, so it's worth a try. – Spudley Mar 09 '13 at 12:48

1 Answers1

0

The only solution I can think of and seem to find is just:

background-size: 10em auto;

The auto to maintain the correct aspect ratio. Since the width is the important property of a background image define the width explicitly. The correct format for a background-size property is:

background-image: width height

Personally I would not use this as a scaling method. You should try to aim to be responsive. Loading different images for different resolutions, a very informative and interesting article by Smashing Magazine

This would be a good start.

I hope this resolves your issue.

ZeroBased_IX
  • 2,667
  • 2
  • 25
  • 46