Build a small navigation example with Home, Search, and a dismiss button using three icons from the same set. You will paste SVG code into the free SVG Sprite Generator , copy its output, and use the resulting symbols in a web page. No framework or build plugin is needed.
Once the generated sprite is included in your page, a visible icon needs only a reference to its symbol. Here is the Home link used in this example:
<a href= "#home" > <svg class= "icon" width= "24" height= "24" aria-hidden= "true" focusable= "false" > <use href= "#icon-home" ></use> </svg> Home </a>
Enter fullscreen mode
Exit fullscreen mode
.icon { width : 1em ; height : 1em ; fill : currentColor ; }
Enter fullscreen mode
Exit fullscreen mode
This short snippet assumes icon-home is already defined in the document. The steps below create that definition; section 3 contains the complete page you can copy.
When a sprite fits
A sprite defines each icon once inside a <symbol> .…