How to Create SVG Sprite
SVG sprite provides the modern way to add icons in web page. Currently avaliable all methods do not provide precise control on icon size and color.
To create svg sprite first we create a svg file like curious.svg. Then add the following code -
style.css
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
Now we can add icon in web using following code -
style.css
| 1 | |
| 2 | |
| 3 | |
We can style the svg using css like :
style.css
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |