How to change color of SVG image using CSS (jQuery SVG image replacement)?

后端 未结 17 1966
死守一世寂寞
死守一世寂寞 2020-11-21 17:36

This is a self Q&A of a handy piece of code I came up with.

Currently, there isn\'t an easy way to embed an SVG image and then have access to the SVG elements vi

17条回答
  •  心在旅途
    2020-11-21 18:00

    If we have a greater number of such svg images we can also take the help of font-files.
    Sites like https://glyphter.com/ can get us a font file from our svgs.


    E.g.

    @font-face {
        font-family: 'iconFont';
        src: url('iconFont.eot');
    }
    #target{
        color: white;
        font-size:96px;
        font-family:iconFont;
    }
    

提交回复
热议问题