• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Problem embedding SVG graphic on web page

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Problem embedding SVG graphic on web page

    I have a simple web page where I include an SVG graphic created with Inkscape using the following mark-up:

    Code:
    <p>
        <img src="myGraphic.svg" alt="myGraphic description" />
    </p>
    When I display the web page with Firefox, it just prints the "alt" description instead of rendering the SVG graphic; when I open the SVG graphic file directly with firefox it renders it perfectly. Where am I going wrong?

    Opera, Chrome and Safari all render the SVG graphic correctly when the web page is opened with them.

    #2
    Originally posted by Addanc View Post
    I have a simple web page where I include an SVG graphic created with Inkscape using the following mark-up:

    Code:
    <p>
        <img src="myGraphic.svg" alt="myGraphic description" />
    </p>
    When I display the web page with Firefox, it just prints the "alt" description instead of rendering the SVG graphic; when I open the SVG graphic file directly with firefox it renders it perfectly. Where am I going wrong?

    Opera, Chrome and Safari all render the SVG graphic correctly when the web page is opened with them.
    Depends on your firefox version. According to Firefox http://www1.chapman.edu/~jipsen/svg/asciisvg.html and
    http://www.w3.org/Graphics/SVG/Test/...elem-22-b.html
    if you have v1.5 and above it should work

    Regards,
    S

    Comment


      #3
      This happens with the latest 3.5.x versions. I haven't tried any earlier versions.

      Comment


        #4
        Originally posted by Addanc View Post
        This happens with the latest 3.5.x versions. I haven't tried any earlier versions.
        I have tried myself the

        http://www.w3.org/Graphics/SVG/Test/...elem-22-b.html

        and i can c .svg graphic. Unistall and re-install FF, maybe is corrupted

        Comment


          #5
          I tried the link and the SVG renders OK. The Firefox browser is probably being a bit picky with the Inkscape generated SVG file. I ran the SVG through the W3C checker and it just comes up with a couple of warnings.

          Comment


            #6
            And the answer is:

            The embedding of SVG through the <img> mark-up isn't fully supported by firefox yet; you need to use the <object> mark-up:

            Code:
            <p>
                <object data="myGraphic.svg" type="image/svg+xml">
                    myGraphic description
                </object>
            </p>
            Hopefully one day, the functionality of all these browsers will converge.

            Comment


              #7
              Originally posted by Addanc View Post
              Hopefully one day, the functionality of all these browsers will converge.
              Microsoft still haven't announced any plans to include SVG support in IE 9, despite the fact that all other browsers show excellent support for it now.

              The really weird thing is that Microsoft sponsored an SVG conference hosted by Google the other month. So they're putting money into helping one of their main competitors spread the word about a technology they themselves don't support. Go figure

              Comment


                #8
                Originally posted by Addanc View Post
                The embedding of SVG through the <img> mark-up isn't fully supported by firefox yet; you need to use the <object> mark-up:
                FYI, here's the relevant bug in Bugzilla

                Comment

                Working...
                X