SVG data image not working on Firefox or Chrome 72+

前端 未结 4 904
轮回少年
轮回少年 2020-11-22 16:43

I\'m setting a SVG as background-image for a pseudo element:

content: \'\';
position: absolute;
 right: 0;
bottom: 0;
  left: 0;
width: 100%;
he         


        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-22 17:16

    You can use the encodeURIComponent(uri) function of JS.

    This function encodes special characters and can encodes also the following characters: , / ? : @ & = + $ #

    Reference: https://www.w3schools.com/jsref/jsref_encodeuricomponent.asp

提交回复
热议问题