Reusing image data URI multiple times in the same

2019-09-16 17:37发布

I'm using the same image multiple times in a single SVG document. Embedding the same image multiple times as a data uri using xlink:href seems like unnecessary file bloat.

What I currently have is: <image xlink:href="data:image/png;base64..." appearing multiple times with the same data uri.

Is there a way to embed a data uri in a separate svg element and then link all the image elements to it, thus avoiding the data duplication?

标签: svg
1条回答
老娘就宠你
2楼-- · 2019-09-16 17:46

You could put the image in a symbol and then point <use> elements at the symbol.

查看更多
登录 后发表回答