Embedded background svg doesn't display on Firefox if it has a “fill” attribute

后端 未结 1 811
南笙
南笙 2021-01-23 02:30

I\'m trying to use .svg embedded in .css as the background of a link. Here is the css rule:

background-image: url(\'data:image/svg+xml;utf8,

        
1条回答
  •  长发绾君心
    2021-01-23 02:56

    You should escape "#" character to "%23" because "#" is hash character in URL string.

    http://jsfiddle.net/dmen16me/

    url('data:image/svg+xml;utf8,');
    

    But I think using base64 is better too.

    0 讨论(0)
提交回复
热议问题