HTML - somewhere inside nav
tag:
<li><a id='readme-link' class='clicked'>README.md</a></li>
CSS
nav a::before {
content: url('icons/file-text.svg');
opacity: 0.87;
margin-right: 0.5ch;
position: relative;
top: 0.5ch;
}
I want to change the color of the link and the fill color of the SVG file when the link is clicked. I'm doing it by adding clicked
class to the a
tag.
I'm having a hard time changing the fill color of the SVG. Following this, my SVG file looks like this:
<?xml-stylesheet type="text/css" href="../style.css" ?>
<svg id='file-text-svg' height="16" width="14" xmlns="http://www.w3.org/2000/svg">
<path d="M6 5H2v-1h4v1zM2 8h7v-1H2v1z m0 2h7v-1H2v1z m0 2h7v-1H2v1z m10-7.5v9.5c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h7.5l3.5 3.5z m-1 0.5L8 2H1v12h10V5z" />
</svg>
And in the CSS I have
path {
fill: FireBrick;
}
I tried to change path
to svg
and couple other stuff but that still doesn't work!