简体   繁体   English

SVG 页面没有加载图片

[英]SVG images are not loaded on the page

I have a website hosted on Amazon S3 (static website hosting).我有一个托管在 Amazon S3 上的网站(静态网站托管)。 All other features are working but weirdly, SVG images are not loading.所有其他功能都在工作,但奇怪的是,SVG 图像没有加载。 Images are located in the sub directory of the site and path is correctly used.图片位于站点的子目录中,路径使用正确。 Please help me how to fix this issue.请帮我解决这个问题。

Please go to the S3 bucket where your website is hosted and select the svg file that you are having problem with.请转到托管您网站的 S3 存储桶,然后选择您遇到问题的 svg 文件。 Go to Properties > Metadata, you will see its content-type is set to different value than image/svg+xml (octet-stream now) Change it to image/svg+xml and reload the page.转到 Properties > Metadata,您将看到它的 content-type 设置为与image/svg+xml不同的值(现在是八位字节流)将其更改为image/svg+xml并重新加载页面。

In my case,my svg file missing value xmlns="http://www.w3.org/2000/svg" in svg tag.在我的例子中,我的 svg 文件在 svg 标签中缺少值 xmlns="http://www.w3.org/2000/svg"。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM