Html – SVG in img tag not loading as image in firefox

firefoxhtmlsvg

I am trying to load my svg file using an img tag but it is not working on firefox. Chrome shows the svg. I am trying to do it like this http://www.schepers.cc/svg/blendups/embedding.html.

Here is my code…

<img src="http://ubuntu.digitalfront.ca/ghcorp/wp-content/uploads/2014/09/hillsdale.svg" alt="" class="img-responsive" />

The svg doesn't show up at all in Firefox. How can I fix this?

Best Answer

We have just encountered an issue where an SVG will not display in Firefox. Preliminary testing suggests that the issue occurs if the ancestor of the img doesn't have a defined width... The img tag doesn't have an inline width or height definition either - so that may not be helping. <div><a><img src="image.svg"/></a></div> In this example - giving the div a width made the svg display.

PS Both the anchor tag and the img tag had css defined widths