【问题标题】:Bootstrap glyphicons are missing缺少引导字形图标
【发布时间】:2020-05-21 02:06:18
【问题描述】:

我不知道为什么,但是我的 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');
}

【问题讨论】:

  • 您能否展示您的代码中链接到字形图标或引导文件的部分?
  • @BlueBoy 谢谢伙计,但已经解决了我的问题!但是,我从引导程序中留下了 glyphicon 字体的一部分

标签: css twitter-bootstrap menu responsive glyphicons


【解决方案1】:

您需要更新它,使用 cdn 链接,将其添加到您的代码中

 <link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

【讨论】:

  • 我是新手,无法投票,但我已经将其标记为正确!
  • Vlw, sou brasileiro também, boa sorte!
【解决方案2】:

你需要在这个链接https://getbootstrap.com/docs/4.5/getting-started/download/下载Bootstrap,下载后你需要把字体放到你的项目中。新版本中没有Bootstrap包中的字体,但可以在旧版本中下载。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-27
    • 2015-08-28
    • 2016-07-23
    相关资源
    最近更新 更多