更新时间:2021-11-02 23:01:12
确保SVG文件提供了正确的MIME类型。打开开发人员工具,转到网络标签并加载您的网页。打开您的SVG文件的URL,并确保类型列中显示 image / svg + xml
。
Make sure the SVG file is delivered with the correct MIME type. Open the developer tools, go to the Network tab and load your page. Open the URL of your SVG file and make sure the Type column says image/svg+xml
.
MIME类型不正确,然后将以下行添加到您的SVG文件的祖先目录中的 .htaccess
文件:
If the MIME type is not correct, then add the following line to an .htaccess
file in an ancestor directory of your SVG file:
AddType image/svg+xml svg
服务器支持 .htaccess
文件)。