Html SVG 无法在 IE 中呈现
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18471711/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SVG not rendering in IE
提问by patdugan
I have a .svg logo on my website, http://www.dailydoog.com, and it renders correctly in every browser except for Internet Explorer. Even newer versions of IE (9+) that have built-in SVG support won't render the logo.
我的网站http://www.dailydoog.com上有一个 .svg 徽标,它在除 Internet Explorer 之外的所有浏览器中都能正确呈现。即使是具有内置 SVG 支持的较新版本的 IE (9+) 也不会呈现徽标。
I'm using the following markup
我正在使用以下标记
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
but it doesn't seem to be having any impact. Am I just missing something really simple here?
但它似乎没有任何影响。我只是在这里错过了一些非常简单的东西吗?
回答by EricLaw
Navigating directly to the SVG in question works fine.
直接导航到有问题的 SVG 工作正常。
If you use the F12 Developer Tools to disable CSS on the page, the SVG image renders.
如果您使用 F12 开发人员工具禁用页面上的 CSS,则会呈现 SVG 图像。
If you remove the width
property from #logo-image img
, it renders, or you can add a height:35px
property instead and the SVG will render.
如果您width
从 中删除该属性#logo-image img
,它会呈现,或者您可以添加一个height:35px
属性,然后 SVG 将呈现。
Perhaps related to this question? SVG in img element proportions not respected in ie9
也许与这个问题有关?在 ie9 中不遵守 img 元素比例中的 SVG