为什么字体真棒在本地主机上的作品,但不是网络? [英] Why font-awesome works on localhost but not on web ?

查看:111
本文介绍了为什么字体真棒在本地主机上的作品,但不是网络?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的字体真棒在我的项目(MVC / asp.net)。我的问题是,我在调试该项目,并检查本地主机,有一个与字体真棒图标没有问题。但公布的网站,检查的图标,而不是基于Web的时候,我看到小盒子。我敢肯定,它被放置在正确的目录(放置在 CSS 文件)。

I'm using font awesome in my project(mvc/asp.net). My problem is, I was debugging the project and check on localhost, there was no problem with font awesome icons. But when published the website and check on web, instead of icons, i saw small boxes. I'm sure that it's placed in right directory(where css files placed).

我找不到任何妥善的解决办法。

I couldn't find any proper solution.

通过还有与按钮没有问题的方式。他们都OK,但图标都不见了。

By the way there is also no problem with buttons. They are all ok but icons are gone.

感谢

推荐答案

我刚刚加载网页并检查萤火虫的净标签。

I've just loaded your webpage and checked the net tab of firebug.

您的以下网址返回404:

your following urls returned a 404:

<一个href=\"http://www.senocakonline.com/Content/font/fontawesome-webfont.woff\">http://www.senocakonline.com/Content/font/fontawesome-webfont.woff

<一个href=\"http://www.senocakonline.com/Content/font/fontawesome-webfont.ttf\">http://www.senocakonline.com/Content/font/fontawesome-webfont.ttf

我会假设,那些被遗漏是你的图标不显示的原因。

i would assume that those being missing is the reason your icons aren't displaying.

更新:2015年10月23日
以使其可只要加入这个code到您的WebConfig:

UPDATE: 23.10.2015 to make it available just add this code to your WebConfig:

<system.webServer>
    <staticContent>
      <mimeMap fileExtension="woff" mimeType="application/font-woff" />
      <mimeMap fileExtension="woff2" mimeType="application/font-woff" />
    </staticContent>
</system.webServer>

这篇关于为什么字体真棒在本地主机上的作品,但不是网络?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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