Skip to content

Instantly share code, notes, and snippets.

@alanpilloud
Created April 18, 2016 08:47
Show Gist options
  • Save alanpilloud/34f0e887bb44671ed8749f6583ce7b4b to your computer and use it in GitHub Desktop.
Save alanpilloud/34f0e887bb44671ed8749f6583ce7b4b to your computer and use it in GitHub Desktop.
<use> with SVG
<!--
Make sure that the viewBox attributes are using the same values.
xlink:href should refer to the id of the <svg> and have a # sign before it.
-->
<div style="display:none">
<svg id="mySVG" width="50" height="50" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg">...</svg>
</div>
<svg viewBox="0 0 50 50"><use xlink:href="#mySVG"></use></svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment