Created
March 3, 2016 20:12
-
-
Save ajzeigert/29bba2ed110aa63a8c12 to your computer and use it in GitHub Desktop.
Proper way to embed an SVG with backward compatibility
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Instead of this --> | |
<img src="path/to/image.svg"/> | |
<!-- Use this --> | |
<div style="width:100%;height:100%"> <!-- Vary this according to your needs --> | |
<object height="100%" width="100%" data="path/to/image.svg" type="image/svg+xml"> | |
<!-- For IE, but will load either way --> | |
<img src="path/to/image.png"></img> | |
</object> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment