首页 >web前端 >css教程 >使用 currentColor 属性更改 SVG 颜色

使用 currentColor 属性更改 SVG 颜色

Susan Sarandon
Susan Sarandon原创
2025-01-14 18:04:43738浏览

Using the currentColor property to change SVG color

CSS 的 currentColor 属性可用于将文本颜色继承到 SVG 中的其他属性,例如 fillstroke。 通过这种方式,您可以通过更改文本颜色来更改整个 SVG 元素的颜色。

查看以下 CodePen 演示:

完整文章:Using the currentColor property to change SVG color CSS 代码片段

以上是使用 currentColor 属性更改 SVG 颜色的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn