I
I
Ilya Vatrushka2018-06-09 00:52:05
css
Ilya Vatrushka, 2018-06-09 00:52:05

Is it possible to fill SVG with color using CSS?

Hello, is it possible to fill an SVG object with color using CSS?

<img class="basket-close-img" src="images/icons/close.svg" alt="close">

SVG - red cross, you need to change it to black.
5b1afa721ff5d943509548.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2018-06-09
@pi4yyy

You can, but then you need to insert the image with the svg tag and use the fill or stroke property.
https://jsfiddle.net/zrpu2kf4/

L
Leo, 2019-01-12
@DLeo13

fill, but there will be problems on safari. It's better to paint first.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question