bootstrap引用时提示字体文件找不到

来源:互联网 发布:淘宝客服话术培训ppt 编辑:程序博客网 时间:2024/06/05 18:53

转载自http://www.zhidao91.com/glyphicons-halflings-regular-woff-404-not-found/



今天查看网站的源代码,发现有个glyphicons-halflings-regular.woff文件没有找到,因为我的网站使用了bootstrap的Glyphicons 字体图标,因此需要加载Glyphicons Halflings的相关文件,但是我的文件中明明有这个文件那怎么会报404错误呢?

Windows主机,需要修改一下配置,让IIS支持这种文件的访问,只需要修改网站根目录下的web.config

在web.config 的systemWebServer标签中加入如下代码

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
      <staticContent>
        <remove fileExtension=".woff"/>
        <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
    </staticContent>

    </system.webServer>
</configuration>



0 0
原创粉丝点击