简体   繁体   English

css中的内联svg过滤器

[英]inline svg filter in css

After reading this question: Inline SVG in CSS (works perfectly on Firefox and Chrome) 阅读此问题后: CSS中的内联SVG (在Firefox和Chrome上完美运行)

body { background-image: 
        url("data:image/svg+xml;utf8,<svg>........</svg>");
      }

I tried to apply some filter effects with 我尝试应用一些滤镜效果

filter: url("data:image/svg+xml;utf8,<svg>........</svg>#filter01")

It worked on FF, but didn't work on Chrome. 它适用于FF,但不适用于Chrome。

What's the reason and how can I fix it? 是什么原因,我该如何解决?

I don't believe you can fix it. 我不相信你能解决它。 This was only ever fully supported by Firefox and this usage will now be superseded by the *-filter property. 这只是Firefox完全支持,现在这个用法将被* -filter属性取代。

尝试在数据字符串上使用escape,就像

filter: url("data:image/svg+xml;utf8,%3Csvg%3E........%3C/svg%3E#filter01")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM