tags:

views:

19

answers:

3

Is there something wrong with this code? The picture displays fine in Safari but Firefox doesn't display anything:

<div id="container"><img src="picture1.svg"/></div>
A: 

SVG files display fine in firefox (open the SVG directly).

Since mozilla treats svg as documents and not as images, you cannot simply use an svg file as an image source in firefox.

See this thread.

Oded
A: 

You need Firefox 4.0b6 or later for svg in img to work there, here's the bug if you're interested. Opera has supported svg-in-img since version 9.5.

Erik Dahlström
I have firefox working now with this code: <object data="picture1.svg" type="image/svg+xml">. Of the five major browsers that just leaves IE, which I cannot for the life of me get the svg to display!
Bazley
That should work just fine in IE9, but for older versions of IE you're going to need a shim like SVGWeb for example. See http://svgboilerplate.com/
Erik Dahlström
A: 

Another solution for IE is Chromeframe http://wsmithdesign.wordpress.com/2010/10/03/html5-in-ie6-7-and-8-with-plugin-dubbed-ie-killer/ Apart from svgweb a plug-gin is needed for IE 6-8 Chromeframe basically adds another personality to the rendering which is standards complaint.

Wayne