I have an svg file, say a.svg, with the content:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
<g fill="none" fill-rule="evenodd">
<line x1="25" y1="15" x2="35" y2="24.6" stroke-width="3" stroke-linecap="round"/>
<line x1="25" y1="35" x2="35" y2="24.6" stroke-width="3" stroke-linecap="round"/>
</g>
</svg>
SVG没有描边颜色,但我希望可以在 CSS 中导入此 SVG 时设置描边颜色,像这样用
<img>
标签导入:HTML:
<img src="a.svg">
CSS(层叠样式表):
img {
stroke: red;
/* This doesn't work */
}
我如何能够做到这一点?