且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用CSS更改svg图像的颜色

更新时间:2022-11-15 09:42:15

您必须使用内联SVG,其中路径元素位于HTML内部,而不是链接到外部SVG。

You have to use an inline SVG, where the path element is inside the HTML, as opposed to linking to an external SVG.

示例: https:// jsfiddle。 net / fznuckb0 / 1 /

Example: https://jsfiddle.net/fznuckb0/1/

.path-name {
    fill: tomato;
    fill-rule: evenodd;
}