Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

10
  • 11
    This is how icons (SVGs) from font-awesome do it. Works great.
    – Peppe L-G
    Commented Jun 14, 2021 at 13:45
  • 27
    Also you may have to change stroke attributes to stroke="currentColor". Commented Sep 29, 2021 at 21:16
  • 166
    It doesn't work if SVG is saved as a file and displayed with <img> tag.
    – Niksr
    Commented Dec 27, 2021 at 12:55
  • 25
    How are you including the SVG, inline or using an img tag? Please include in your answer.
    – racitup
    Commented Jan 12, 2022 at 17:29
  • 24
    Should add that it only works if you are using the svg inline in the html.
    – darrendev
    Commented Apr 23, 2022 at 13:17