How to add a class to SVG path

How can I add classes to SVG paths using notepad editor?
I am using to edit SVG files.

Just the same as you would add a class to an html element, by adding a class attribute.

<path class="myClass" d="M1.889,320c37.558-23.288,60.042-100,60.042-100l79.958,40C141.889,260-19.111,333.021,1.889,320z"/>

Though to be able to target that with css the svg code must be inserted into the document in-line, it can’t be referenced by an <img> tag for example.


That worked thank you :slight_smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.