#icon-visit{
fill: purple;
}
]]>
</style>
<defs>
<symbol id="icon-visit" viewBox="0 0 1024 1024">
<title>visit</title>
<path class="path1" d="M832 960l192-512h-832l-192 512zM128 384l-128 576v-832h288l128 128h416v128z"></path>
</symbol>
</defs>
</svg>
This is my very simple sheet - I wanted to change the fill of my icon with CSS in the sprite sheet itself since I'm using <use> to put it into my HTML but no matter what I put - if I put the fill on the path, stroke or color, or if I do fill/stroke/color on the #icon-visit itself...
How do you actually change the fill color of an icon when it's style in the sheet itself?
Thank you!
<head>
<title></title>
<link rel="icon" type="text/xml" href="images/symbol-defs.svg" />
</head>
<body>
<svg class="itemicon icon-visit" style="float: left; width: 16px; height: 16px; margin-right: 4px;">
<use xlink:href="images/symbol-defs.svg#icon-visit">
</use>
</svg>
</body>
This code makes the icon appear no problem. In the actual SVG file, not in a CSS file, I'm trying to get the color to change on the icon. I posted the actual SVG code up above. If I change it to color instead of fill, nothing changes.
<svg style="position: absolute; width: 0; height: 0;" width="0" height="0" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<style type="text/css" >
<![CDATA[
#icon-visit{
color: purple;