Linking to CSS in an SVG embedded by an IMG tag

前端 未结 3 923
离开以前
离开以前 2020-11-28 12:59

I have a page, that includes several SVG files. To synchronize the styling of those SVG files I wanted to create a single stylesheet to hold all styling information.

3条回答
  •  抹茶落季
    2020-11-28 13:31

    An alternative is to use the tag in your html :-

    
    

    It's a BIG shame the tag won't work. I don't want to mess about hacking with converting the SVG to a data URI. It's to do with cross-site vulnerabilities on indirectly loading resources and the use of an "Open Redirector".

    Note that in my testing lastnight, the tag method DOES work in IE10, but neither Chrome nor FireFox.

    I don't know why is allowed and isn't. An oversight?

    提交回复
    热议问题