Reputation: 686
I've the html code here. The svg does not render with IE 11. Can't find out why.
I've added as seen in another place :
<meta http-equiv="X-UA-Compatible" content="IE=edge">
I suspect the image is here but not visible. Or it could be the large data=
which is not interpreted correctly. How to check ?
Upvotes: 3
Views: 30207
Reputation: 1
I have a similar problem when I use the xlink:href attribute to display my svg imgage in IE11, it only display a empty layout without any content.The svg seems like:
<svg>
<symbol id="xxx">
<g>
<path>
</path>
<g>
</symbol>
</svg>
when I delete the "g" Tag:
<svg>
<symbol id="xxx">
<path>
</path>
</symbol>
</svg>
it have a correct presentation, I hope the answer can help other developers to resolve their questions.
Upvotes: 0
Reputation: 58460
I had a similar issue and in my case it was because IE requires the viewBox
attribute to be specified within the SVG for scaling to work correctly, and it was missing from my SVG.
I changed:
<svg xmlns="http://www.w3.org/2000/svg" width="767" height="1024">
to:
<svg xmlns="http://www.w3.org/2000/svg" width="767" height="1024" viewBox="0 0 767 1024">
The viewBox attribute specifies <x-origin> <y-origin> <width> <height>
.
This article helped me understand the reasons for this: How to scale SVG [css-tricks.com].
Upvotes: 9
Reputation: 686
What I've done to make it work :
In the svg
file :
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/SVG/DTD/svg10.dtd">
height
& width
propertiesxmlns="http://www.w3.org/2000/svg"
in the svg
markupIn the html
file :
img
element instead of object
: <img src="..." style="width:95%;height:60%" />
Upvotes: -2