Skip to content

Instantly share code, notes, and snippets.

@Rykus0
Forked from technopagan/style.css
Created December 5, 2012 15:00
Show Gist options
  • Save Rykus0/4216189 to your computer and use it in GitHub Desktop.
Save Rykus0/4216189 to your computer and use it in GitHub Desktop.
Progressive Enahncement to use SVG sprites with PNG fallback for IE6+7
/**
* Progressive Enahncement to use SVG sprites with PNG fallback for IE6+7
*
* The trick:
* Legacy IE does not support rgba values.
* By defining a rgba background color together with the
* SVG background image for all modern browsers, legacy IE
* will ignore the SVG and use the
* first background definition containing the fallback PNG
*
* Compatibility:
* Safari 5.1+
* Chrome 16
* Firefox 9+
* Opera 11.6+
* MobileSafari on iOS 5
* IE6, IE7, IE8, IE9
*
* Known Issues:
* - Does not work in Firefox < 4
* - Might not work on older versions of Android Browser
*
*/
.sprite {
background: url(sprite.png) no-repeat 0px 0px;
background: rgba(0,0,0,0) url(sprite.svg) no-repeat 0px 0px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment