0

This is my code:

<svg class="navbar-brand" src="/Images/logo.svg" alt="Apps Architect"></svg>

I have tried changing svg to img or embed. With img image is not rendering but alternate text is showing. With embed image is not showing, alternate text neither. So I have changed:

xlink:href="data:img/png;base64,

to:

xlink:href="data:image/png;base64,

I've added div <div><img class="navbar-brand" src="/Images/logo.svg" alt="Apps Architect"></div>

I've change xlink:href instead of src.

Then I've tried to use:

<image ... xlink:href="...">

But it doesn't change anything.

EDIT: I've added width and height but it doesn't change anything. But it shows properly after compiling in Visual Studio. Only on the server it doesn't showing. I've added png file instead svg and it doesn't showing neither.

15
  • @xmastertje u mean svg file?
    – P. M.
    Commented May 3, 2019 at 11:07
  • no your folder structure. My bad used a dutch word
    – xmaster
    Commented May 3, 2019 at 11:08
  • Is your SVG anyway valid? Are you able to preview it in the developer tools? <svg> and <image> is actually not valid HTML but XML in SVG (open your svg image with a text editor and check the XML inside it). To display a SVG image in browser you have to use the "normal" <img src="bla.svg"/> image element.
    – RajmondX
    Commented May 3, 2019 at 11:10
  • @xmastertje svg file is in the Images folder and html file is in the main folder. Main/Images
    – P. M.
    Commented May 3, 2019 at 11:10
  • Add your folder structure. Also see if you are referring to actual path. Commented May 3, 2019 at 11:11

1 Answer 1

1

I've found a solution in my path there was "/Images/logo.svg" and it should be "Images/logo.svg"

Not the answer you're looking for? Browse other questions tagged or ask your own question.