inline svg filter in css

我是研究僧i 提交于 2021-01-27 07:28:09

问题


After reading this question: Inline SVG in CSS (works perfectly on Firefox and 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.

What's the reason and how can I fix it?


回答1:


try to use escape on the data string , like

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



回答2:


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.



来源:https://stackoverflow.com/questions/13925736/inline-svg-filter-in-css

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!