有什么想法为什么图案化的SVG文件在浏览器中显示为空白? [英] Any ideas why patterned SVG file is showing up blank in the browser?

查看:709
本文介绍了有什么想法为什么图案化的SVG文件在浏览器中显示为空白?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在Illustrator中创建的svg文件,其中包含一个模式-它是使用色板工具制作的.当我尝试在本地加载它时,它在浏览器中显示为空白.

I have an svg file that I created in Illustrator that consists of a pattern - it was made using the swatch tool. When I try and load it locally it shows up blank in the browser.

如果要对其进行测试,请参见以下文件: http://d.pr/ZvhV

Here is the file if you want to test it: http://d.pr/ZvhV

推荐答案

如果您发现它适用于Firefox,IE或Edge,但不适用于Chrome,这也是我的问题.

If you find that it works in Firefox, IE or Edge but not Chrome, this was my issue too.

我通过在文本编辑器中打开.SVG文件来修复它,并且在所有看到此标记的地方:

xlink:href="data:img/png;base64

我用

替换了 xlink:href="data:image/png;base64

I fixed it by opening the .SVG file in a text editor, and everywhere I saw this tag:

xlink:href="data:img/png;base64

I replaced it with

xlink:href="data:image/png;base64

此问题已修复,并立即显示.希望这对某人有帮助!

This fixed it, and it displayed immediately. Hopefully this helps someone!!

这篇关于有什么想法为什么图案化的SVG文件在浏览器中显示为空白?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆