有一个解决方法,以获得在< img>中加载的SVG中的正确字体支持。 Chrome + Safari中的标记? [英] Is there a workaround to get proper font support in SVG loaded in an <img> tag in Chrome + Safari?
问题描述
我使用带有我的SVG标记的数据URI,并将其粘贴在< img> $ c>的
src
$ c>标记。在FireFox中运行良好,但在Chrome / Safari中,我失去了字体支持。
I'm using a data URI with my SVG markup and sticking it in the src
attribute of an <img>
tag. Works fine in FireFox, but in Chrome/Safari I lose the font support.
请参阅: http://jsfiddle.net/3vhR7/
有这样的解决方法,我仍然可以使用< img>
(而不是< embed>
或< object>
?
Is there a workaround for this such that I can still use <img>
instead of <embed>
or <object>
?
编辑:我将此提交给 caniuse.com 他们将其确认为错误
I submitted this to caniuse.com and they confirmed it as a bug
推荐答案
为什么不能使用对象标签?非常简单和超级有趣。
Why can't you use an object tag? It's easy and super fun.
<object type="image/svg+xml" data="chart.svg">
<img src="fallback.png" alt="No SVG Support"/>
</object>
YAY! (Monty Python版本)
YAY! (the Monty Python version)
这篇关于有一个解决方法,以获得在< img>中加载的SVG中的正确字体支持。 Chrome + Safari中的标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!