Reputation: 33545
I have used a couple of svg images from OpenClipart in my site. The svg images get properly displayed in Chrome and Firefox. But, when I see the site is IE11 the image is shown as below. I tried a couple of tips from SO and other sites, but they didn't make any difference.
Here is the site built using blogger. And here is the corresponding html code.
<a href="http://www.thecloudavenue.com/search/label/gettingstarted">
<img src="http://openclipart.org/people/shokunin/runer_start.svg" style="border: none" height="110" width="110" align="middle"/>
</a>
How to get around this? If I replace svg with some other type, then it should work. But, I am curious why svg are getting displayed.
Upvotes: 0
Views: 8457
Reputation: 135
You need something like the following declaring the svg containers with the image tags inside. This example has two images so I can toggle an active/inactive condition with Javascript. Also you must close the image tags manually, "<image />" self closing tags are not allowed in IE.
<svg id="globalNav_icon_usersSearch" height="20" width="20" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<image class="icon_search" x="0" y="0" height="20" width="20" xlink:href="svg/icon_search.svg"></image>
<image class="icon_search_grey" x="0" y="0" height="20" width="20" xlink:href="svg/icon_seacrh_grey2.svg"></image>
</svg>
Upvotes: 0
Reputation: 24637
IE support for SVG deviates from the standard in several areas. Here are a few:
marker
elementpathLength
attribute is not supportedviewBox
elements in fragment specifications may be delimited by single spaces in addition to commasdisplay
property affects pattern
elements and references to those pattern
elements.animation
elements, properties, attributes, interfaces, or data types in other chapters of SVG 1.1 are supported.animVal
attribute is animVal = baseVal
.References
Upvotes: 2