我下载了引导3.0,但无法让象形文字工作。我得到一些"E003"错误。知道为什么会这样吗?我在本地和网上都试过了,还是遇到同样的问题。


当前回答

这是由于bootstrap.css和bootstrap.min.css中的错误编码。当你从定制器下载Bootstrap 3.0时,以下代码是缺失的:

@font-face {
  font-family: 'Glyphicons Halflings';
  src: url('../fonts/glyphicons-halflings-regular.eot');
  src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
}

因为这是使用Glyphicons的主要代码,所以它不会在ofc…

从完整的包中下载css文件,这段代码将被实现。

其他回答

这个答案适用于任何使用Nancy (Nancy fx)的人。

我有一个ASP。net托管的NancyFX应用程序,我通过NuGet获得了Boostrap。

我的字形不能工作,但事实证明不是糟糕的字体文件、不正确的CSS相对目录路径或其他答案中提到的任何其他事情的问题。

问题是我错过了一个惯例,告诉南希去哪里寻找内容。一旦我意识到这一点,解决方案就是简单地在我的bootstrapper文件中添加以下重载:

protected override void ConfigureConventions(NancyConventions nancyConventions)
{
    base.ConfigureConventions(nancyConventions);
    nancyConventions.StaticContentsConventions.Add(
        StaticContentConventionBuilder.AddDirectory("/fonts"));
    nancyConventions.StaticContentsConventions.Add(
        StaticContentConventionBuilder.AddDirectory("/Scripts"));
}

我使用VS2015, ASP。NET MVC 6 (RC),并且在生产(在VS(开发)中工作)中gliphicons也有问题(引用的错误消息,图标没有显示)。 原因似乎是,微软cdn页面关闭了(至少现在来自瑞士): http://www.websitedown.info/ajax.aspnetcdn.com

因此(作为临时解决方案),我已经改变了_Layout中的外部引用。cshtml(在环境名称下="Staging,Production")到"internal"引用: 来自:

<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.5/css/bootstrap.min.css"

to

<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css"

在此之后,它又可以工作了。

您的字体目录中是否有以下所有文件

glyphicons-halflings-regular.eot
glyphicons-halflings-regular.svg
glyphicons-halflings-regular.ttf
glyphicons-halflings-regular.woff
@font-face {
     font-family: 'Glyphicons Halflings';
      src: url('../fonts/glyphicons-halflings-regular.eot');
      src: url('../fonts/glyphicons-halflings-regular.eot?#iefix')         format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');}

我使用bootstrap命名空间和象形文字不工作,但在代码中添加上面一行象形文字工作正常。

我也有同样的问题,除了在本页的隐藏评论中,我找不到任何关于它的信息。根据Chrome浏览器,我的字体文件加载正常,但图标显示不正常。我把这个作为答案,希望能帮助到其他人。

我从Bootstrap 3的定制工具下载的字体文件有问题。要获得正确的字体,请访问Bootstrap主页并下载完整的.zip文件。从那里提取四个字体文件到你的字体目录,一切都应该工作。