Image url downloads the image instead of displaying it

后端 未结 3 1849
[愿得一人]
[愿得一人] 2021-01-17 12:32

I just switched the site from my working files to the server.

It worked fine when I uploaded it to my portfolio but once it was on the correct domain it stopped work

相关标签:
3条回答
  • 2021-01-17 12:49

    try use <object data="/images/login_header.svg" type="image/svg+xml"></object> instead

    0 讨论(0)
  • 2021-01-17 13:04

    Some browsers don't allow the IMG tag to support SVG files, you can however put it in an object with an image as fallback in case the browser fails to render.

    <object data="image.svg" type="image/svg+xml">
      <img src="fallbackimage.jpg" />
    </object>
    
    0 讨论(0)
  • 2021-01-17 13:08

    Is your server sending the .svg file down with the correct MIME type? It should be image/svg+xml.

    See Nginx offers of downoload SVG instead of showing it for another question along the same lines.

    0 讨论(0)
提交回复
热议问题