SVG to Base64 Bookmarklet

Use this bookmarklet when viewing an svg file on the browser, to automatically convert it to base64 encoding.

Then you can include it inline in a css file as a background image, as such:

background-image: url(data:image/svg+xml;base64,[output]);

Source (makesites.org)


Download Bookmarklet:


View Bookmarklet Code:

Bookmarklet Source Code:

javascript%3Abtoa%28%20new%20XMLSerializer%28%29.serializeToString%28document.getElementsByTagName%28%22svg%22%29%5B0%5D%29%20%29


Rate it:


Tags:

Comments

Comments so far. Add yours.