How to change color of SVG image element with path code ?

How can I change the color of SVG image element, created by path code ?

For example, when I use SVG image as a link:

<a href='index.php' ><img src='icon.svg' style='color: navy; fill: navy; border: 0px;' ></a>

But in this case CSS color or fill doesn't work.
0
give a positive ratinggive a negative rating
07 Nov 2022 at 04:41 PM
Hi,

If you use SVG image as a file, to change the color, you have to modify the source code of icon.svg image.

For example:

<svg viewBox="0 0 100 100" fill="navy" xmlns="http://www.w3.org/2000/svg">
<path d="M20 50a30 30 0 1 0 60 0a30 30 0 1 0 -60 0"></path>
</svg>
0
give a positive ratinggive a negative rating
07 Nov 2022 at 07:52 PM
Tim
Share on FacebookShare on TwitterShare on LinkedInSend email
x
x
Follow us on Facebook
2022 AnswerTabsTermsContact us