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

后端 未结 17 1951
死守一世寂寞
死守一世寂寞 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:12

    Alternatively you could use CSS mask, granted browser support isn't good but you could use a fallback

    .frame {
        background: blue;
        -webkit-mask: url(image.svg) center / contain no-repeat;
    }
    

提交回复
热议问题