VS2012中的SVG文件 [英] SVG files in VS2012

查看:74
本文介绍了VS2012中的SVG文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

浏览我的MVC 4网站时,突然我的SVG文件无法正确显示.它们在其他项目中也可以正常工作,并且在IIS中而不是ASP.NET Development Server中托管时,同一项目可以很好地显示图像.我尝试使用下面的代码添加MIME,但未做任何更改.感觉这确实是一夜之间发生的.真是令人困惑.

All of a sudden my SVG files don't get displayed properly when browsing my MVC 4 site. They work fine in other projects and the same project displays the images fine when hosted in IIS instead of ASP.NET Development Server. I tried adding the MIME using the code below but it didn't change anything. It feels like this literally happened over night. Really confusing.

<staticContent>
  <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
</staticContent>

推荐答案

调用svg文件的最佳方法是:

the best way to call svg files is this:

<object data='svg-test.svg' type='image/svg+xml' width='500' height='500' />

这篇关于VS2012中的SVG文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆