Can you define defs when using a series of symbols in an SVG element? -


i trying define defs 1 of svgs using. set have load of reusable icons symbols in svg tags:

<svg>   <symbol id="id" viewbox="...">     <path fill="#..." d="..."/>     <path fill="#..." d="..."/>   </symbol>    <symbol id="id" viewbox="...">     <path fill="#..." d="..."/>     <path fill="#..." d="..."/>   </symbol>    <symbol id="id" viewbox="...">     <path fill="#..." d="..."/>     <path fill="#..." d="..."/>   </symbol> </svg> 

to display 1 of icons:

<svg>   <use xlinkhref='#id'></use> </svg> 

i have icon has gradient, specified in defs tags, i'm not sure how works method of using svgs. way specify defs tags in use block of code:

<svg>   <defs>     <lineargradient ...>       <stop stopcolor=“#... " offset=“0%“></stop>       <stop stopcolor=“#...” offset=“100%“></stop>     </lineargradient>   </defs>   <use xlinkhref='#id'></use> </svg> 

or can put in same location symbols defined re-use, don't have re-specify every time use icon?

thank you


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -