【问题标题】:Some Glyphicons in Bootstrap not found未找到 Bootstrap 中的某些字形图标
【发布时间】:2015-05-09 00:50:18
【问题描述】:

我正在尝试在 Bootstrap 中使用 Glyphicons,但出现此错误:

> http://address/fonts/glyphicons-halflings-regular.woff2
> http://address/fonts/glyphicons-halflings-regular.woff  GET
> http://address/fonts/glyphicons-halflings-regular.ttf 404 (Not Found)

我不知道该怎么做,我已经尝试了 StackOverflow 上提出的所有解决方案。

【问题讨论】:

  • 您确定已下载并复制到正确的目录吗?
  • 是的,我确定。在 www/fonts/ 文件夹中。而boostrap.css文件中的url就是商品:“../fonts/glyphicons-halflings-regular.ttf”
  • css文件的引用路径是否正确?
  • 如果您下载了 bootstrap.zip 并且没有将其复制到相同结构的文件夹中 - css 文件将像在相同的文件夹结构中一样查找它。 (我的猜测是错误是css文件在寻找字体并且由于文件夹结构不同而无法找到它们)
  • 结构一模一样...

标签: css twitter-bootstrap fonts glyphicons


【解决方案1】:

尝试在您的 .htaccess 中添加 ttf|woff|woff2

RewriteRule !.(js|css|ico|gif|jpg|png|mp4|ttf|woff|woff2)$ index.php

【讨论】:

    【解决方案2】:

    只需使用

    <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
    

    找其他人

    glyphicon glyphicon-*

    http://getbootstrap.com/components/#glyphicons-glyphs

    并确保您包含引导 css

    【讨论】:

    • 我已经尝试了很多图标,并且包括引导 css。 "" 例如。最大的谜团是有些图标像“信封”一样工作,而其他图标则不然。
    • 您是使用自定义引导程序还是仅包含 maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
    • 直接包含应该没问题
    猜你喜欢
    • 2022-06-13
    • 1970-01-01
    • 1970-01-01
    • 2020-11-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-20
    • 2015-12-03
    相关资源
    最近更新 更多