Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE11 meta element Breaks SVG

I've embedded an SVG files data directly into my html. It shows in Chrome and Firefox, but in IE11 it doesn't show at all. The pastebin link to the SVG is http://pastebin.com/eZpLXFfD

I've tried adding a META TAG but to no avail. At first I thought it might be a IE Compatibility view issue, but toggling that feature did not work either.

<meta http-equiv="X-UA-Compatible" content="IE=8">

Any help? What else Information Can I provide to help answer this question

like image 900
Rahil Pirani Avatar asked Dec 15 '14 22:12

Rahil Pirani


People also ask

Does IE 11 support SVG?

SVG does not render in IE11 when used in Lightning components. This is working as designed, and looks to be a limitation of Internet Explorer (IE). More specifically, it is due to using svg.

Does SVG work in Internet Explorer?

SVG (Scalable Vector Graphics) is officially supported by all main web browsers, including Internet Explorer. The support spans into a wide variety of image editor software, particularly Inkscape, which uses SVG as its native format (If you want a refresher on SVG, click here).

Why is my SVG saving as Internet Explorer?

Replies (1)  Those files are okay, they are just opening in the wrong program . . . Internet Explorer in Windows is the default SVG viewer, you just need to change the file associations on svg files . .. Important - Check the box marked 'Always use this app to open svg . . .'


2 Answers

It sounds as though you're not in a modern document mode. Internet Explorer 11 shows the SVG just fine when you're in Standards Mode. Make sure that if you have an x-ua-compatible meta tag, you have it set to Edge, rather than an earlier mode.

<meta http-equiv="X-UA-Compatible" content="IE=edge"> 

You can determine your document mode by opening up your F12 Developer Tools and checking either the document mode dropdown (seen at top-right, currently "Edge") or the emulation tab:

enter image description here

If you do not have an x-ua-compatible meta tag (or header), be sure to use a doctype that will put the document into Standards mode, such as <!DOCTYPE html>.

enter image description here

like image 74
Sampson Avatar answered Nov 07 '22 18:11

Sampson


I was having the same problem with 3 of 4 inline svgs I was using, and they only disappeared (in one case, partially) on IE11.

I had <meta http-equiv="x-ua-compatible" content="ie=edge"> on the page.

In the end, the problem was extra clipping paths on the svg file. I opened the files on Illustrator, removed the clipping path (normally at the bottom of the layers) and now they're all working.

like image 31
rafaelbiten Avatar answered Nov 07 '22 19:11

rafaelbiten