SVG (retina and sizes)
Use "em" property size to scale SVG relative to the other elements. When one uses a retina display the elements will be twice as big, which will result in the SVG scaling nicely on retina and on normal displays.
SVGs for small sprites could be twice the size of PNGs, however, when using very large images the SVG file-size drops dramatically.
background-image: url('sprite.svg');
-webkit-background-size: 1.875em 10em;
-o-background-size: 1.875em 10em;
-moz-background-size: 1.875em 10em;
background-size: 1.875em 10em;
/* styles carried over from the original implementation */
background-repeat: no-repeat;
background-color: #ccc;
Written by Chase
Related protips
1 Response
Interesting. Thanks for the tip!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#