【问题标题】:How and where should I add the Glyphicons folder to my project?我应该如何以及在哪里将 Glyphicons 文件夹添加到我的项目中?
【发布时间】:2016-11-16 16:11:34
【问题描述】:

似乎没有文档,我在 Stackoverflow 上找不到任何好的解决方案/指南。

我应该如何以及在哪里将 Glyphicons 文件夹添加到我的项目中?

我的应用文件夹结构:

-quickstart-master
     -app (*Here are my js anf html files*)
     -node_modules
        -bootstrap
           -fonts
     ....
    -index.html

【问题讨论】:

  • 对不起,我以为你指的是 Bootstrap 的 default glyphicons
  • 我不在乎使用哪个图标。你能回复你的答案并告诉我如何使用它吗?非常感谢,如有任何困惑,我深表歉意!

标签: css twitter-bootstrap-3 icons glyphicons


【解决方案1】:

由于 Bootstrap 分发文件暗示将其放在与您的 js 和 css 文件夹相同级别的 fonts 文件夹中:

|
|--js_folder_name/bootstrap.js
|--css_folder_name/bootstrap.css
|--fonts/ <---- put all the glyphicons files here
|

如果您想更改为自定义文件夹,您可以编辑bootstrap.css中的路径:

@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');
}

【讨论】:

    猜你喜欢
    • 2018-09-01
    • 2016-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-10
    • 1970-01-01
    相关资源
    最近更新 更多