Embed SVG in SVG?

前端 未结 6 596
無奈伤痛
無奈伤痛 2020-11-27 11:00

I have an SVG document, and I would like to include an external svg image within it, i.e. something like:



        
      
      
      
6条回答
  •  忘掉有多难
    2020-11-27 11:39

    I needed to embed a SVG in my SVG but also change its color and apply transforms.

    Only Firefox supports the "transform" attribute on the nested svg elements. Changing the color of is also not possible. So a combination of both was needed.

    What I ended up doing was the following

    
      
    
    

    This works on at least Firefox, Chrome and Inkscape.

    This behaves the same as the child svg in the parent svg answer with the exception that you can now apply transforms on it.

提交回复
热议问题