-9o3oa
Last Updated: February 25, 2016
·
2.926K
· creativeaura

SVG with PNG fallback for IE8

All browsers that support SVG background images also supports multiple background images.

CSS

.module {
    background: url('logo.png');
    background: none, url('logo.svg');
}

SASS

$public_path: ./;

@mixin vector-bg-with-fallback($name) {
    background-image: url('#{$public_path}images/#{$name}.png');
    background-image: none, url('#{$public_path}images/#{$name}.svg');
}

Sourec : Ben Schwarz.

1 Response
Add your response

4415

Android 2.3 and below didn’t support SVG but did support multiple-background, this would probably reset the first PNG background-image definition to none.

over 1 year ago ·