Skip to main content
Inspiring
December 3, 2017
Answered

why svg swap from png not displaying

  • December 3, 2017
  • 2 replies
  • 783 views

Hi,

Logo was a .png. Decided to convert to SVG, ensuring artboard dimensions matched original PNG.

Swapped with a find & replace. Tested in live view locally, and nothing displays.

Any idea?

<h1 class="navbar-brand navbar-brand_"><a href="index.html"><img src="img/logo.svg" alt="logo"></a></h1>

    This topic has been closed for replies.
    Correct answer r_tist

    Needed to include the dimensions in the src call. Then, it appeared.

    2 replies

    BenPleysier
    Community Expert
    Community Expert
    December 4, 2017

    Rather than us guessing at what is going on, it is much better to upload the project to a (temporary) online location. When you then give us the link to that location, we will be able to see first hand at what is going on.

    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
    r_tistAuthorCorrect answer
    Inspiring
    December 5, 2017

    Needed to include the dimensions in the src call. Then, it appeared.

    pziecina
    Legend
    December 5, 2017

    Just as an update to others with the same problem, there is no need to include the dimensions in the img src call, and it is recommended that when using the html5 doctype you do not do so. Either use css to set the dimensions or allow the containing element to 'set' the svg size for you.

    svg is a vector format and will scale to any dimension without loss of quality, providing the svg uses % in its settings.

    pziecina
    Legend
    December 3, 2017

    First thing to check is your file path, then if that does not work create a new html page just with the image link to the svg on the page.

    Also have you made certain the svg format is correct, (open the svg directly in Dw). If nothing is displayed your svg headers, (xml type declaration etc) are probably incorrect or missing. If you created the svg in illustrator did you remember to 'export as svg', as simply saving as svg will not work.