P
P
Pavel_Proca2016-11-15 18:22:07
css
Pavel_Proca, 2016-11-15 18:22:07

How easy is it to use SVG icons so that you can change their color with CSS?

For example, there is a folder with icons in the name.svg format . How can I add them to an HTML document so that I can change their color with CSS? I tried to add them as a regular picture, using , but:
1 the color of the icons cannot be changed by any methods known to me
2 I think that this is not correct
Please help. Googled, but never found a sensible article that would explain how to do this easily and simply.
Is it possible to somehow add them as a font, so that font-size can also be set?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Peter, 2016-11-15
@petermzg

1. Embed svg into the page.
2. For its elements, color must not be specified through attributes.

A
Alexey, 2016-11-15
@skazi_premiere

Inkscape for creating fonts. Or you can search for an online service. And so open it with notepad and copy in HTML what is between the svg tags. Then in CSS it will be possible to change the fill property of this object.

A
Archakov Dennis, 2016-11-15
@archakov06

Use SVG sprites .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question