最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

change with CSS the color of an svg background image set with "background-image: url()"

programmeradmin3浏览0评论

does anyone knows if it is possible to change the color (the stroke and fill attributes) of a SVG illustration used as a background with background-image: url() directly via CSS?

Thank you

does anyone knows if it is possible to change the color (the stroke and fill attributes) of a SVG illustration used as a background with background-image: url() directly via CSS?

Thank you

Share Improve this question asked Aug 13, 2020 at 16:55 DandeDande 351 silver badge8 bronze badges
Add a comment  | 

1 Answer 1

Reset to default -1

Yes, you can absolutely do this with SVG, as long as you're using inline SVG code, which you'll need a program like Adobe Illustrator to produce. You may be able to use an online tool (like this one) but I haven't tried that.

Chris Coyier of CSSTricks.com did an excellent write up of this.

Fork his SVG codepen and play around with it to get a feel for how it works.

Good luck!

发布评论

评论列表(0)

  1. 暂无评论