I have a circle.svg
file
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="48" height="48">
<circle class="circle" cx="24" cy="24" r="24"></circle>
</svg>
And a HTML file
...
<div class="bullet blue">
...
</div>
<div class="bullet red">
...
</div>
<style>
.bullet:before {
content: url(circle.svg);
}
.bullet.blue:before {
.circle {
fill: #0000FF;
}
}
.bullet.red:before {
.circle {
fill: #FF0000;
}
}
</style>
I want the circle be filled by the style sheet, but it's not working. However if I embed the svg code into the HTML, the style sheet would take effect on it, but I don't want to insert extra resources in HTML code. Is there a way to do it via CSS? If not, how about using JavaScript?