The CSS background-size only exception for background-size difficult, but yes, it can be done.
The trick is to use the short form background style to set various background properties, and not to use individual styles like background-size , background-image , etc.
So, in your case, you will have something like this:
background: url(img2x.jpg) 0% 0%/100%;
( 0% 0% for background-position (0% 0% by default), which is required before the background-size when using the short form style).
So far, all I have done is compressing your existing code into one short CSS line, but the smart bit is that now we have done it, a browser that does not recognize background-size will throw to separate the entire line, not just drop the background-size yourself.
This means that we can specify a completely different set of background values โโfor older browsers.
background: url(ie8bg.jpg); background: url(img2x.jpg) 0% 0%/100%; /* shown by new browsers with background-size support*/
Here you can see a demonstration of this here . Modern browsers will get one background image stretched to 100% background-size , while older browsers (like IE8) will get a completely different image without stretching.
Since you can define a completely separate background for older browsers, you can even do things like a solid background color for IE8 rather than an image, while preserving the image for other browsers.
So yes, a fully CSS solution that gives you a reserve for browsers that do not support background-size .
Hope this helps.
[EDIT]
Browser compatibility can be a minor issue. Some browsers may support background-size but not support it as part of the short background syntax. For the most part, this only applies to older browsers (e.g. Firefox 7), but this is still a problem in current versions of Safari. This means that with this technology Safari will see the background, although it actually supports background-size .
This is obviously not ideal, but this is mitigated by the fact that it will at least get a reverse image, which means that the page should look at least as good, if not as good, as in other browsers. We hope that this problem in Safari will be fixed in a future version.
At the same time, this fact does not detract from the fact that this answer is a valid solution to the question - it really provides a fallback in pure CSS.
In light of this question, I wrote a blog post on this subject , which I hope will describe it in more detail and provide other options if this CSS rollback solution is not enough.