Bootstrap图标字体丢失了。

3

我不知道为什么,但是我的Bootstrap字体图标(3.3.7)丢失了,它们被普通且难看的正方形替换了。以下是一个调用缺失字体图标的代码示例:

        <button type="button" class="btn btn-default">
          <span class="glyphicon glyphicon-star" aria-hidden="true"></span> Star
        </button>

以下是包含glyphicon字体的Bootstrap代码:

 @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.woff2') format('woff2'), 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或bootstrap文件的部分吗? - Blue Boy
@BlueBoy 谢谢你,但是我已经解决了我的问题!不过,我还留下了 Bootstrap 中 glyphicon 字体的部分。 - Vithor Escames
3个回答

6
你需要更新它,使用CDN链接,并将此代码添加到你的代码中。
 <link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

我在这里是个新手,无法点赞,但我已经标记为正确了! - Vithor Escames
Vlw,我也是巴西人,祝你好运! - Otávio Barreto

1

0

当我添加缓存时,我也遇到了同样的问题。VS会更新Web配置文件,其中包含

            <clear/>
            <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="00:01:00" />
            <mimeMap fileExtension=".jpg" mimeType="image/jpg"/>
            <mimeMap fileExtension=".png" mimeType="image/jpg"/>
            <mimeMap fileExtension=".css" mimeType="text/css"/>
            <mimeMap fileExtension=".js" mimeType="text/javascript"/>

当您删除或注释掉这些行时,图标字形将重新显示。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接