IE11 meta element Breaks SVG

前端 未结 7 1779
半阙折子戏
半阙折子戏 2020-12-03 02:38

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

相关标签:
7条回答
  • 2020-12-03 03:29

    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

    0 讨论(0)
提交回复
热议问题