Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

why svg swap from png not displaying

Enthusiast ,
Dec 03, 2017 Dec 03, 2017

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>

802
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Dec 05, 2017 Dec 05, 2017

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

Translate
LEGEND ,
Dec 03, 2017 Dec 03, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 03, 2017 Dec 03, 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!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 05, 2017 Dec 05, 2017

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 05, 2017 Dec 05, 2017
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines