如何在3.0.0中使用Bootstrap Glyphicons?

Rob*_*ews 18 icons twitter-bootstrap glyphicons

我在Bootstrap中使用Glyphicons.我直接从http://glyphicons.getbootstrap.com/css/bootstrap-glyphicons.css调用CSS,但现在已经消失了,不推荐.

这显然恰好与Twitter再次在Bootstrap包中提供Glyphicons相吻合.我正在使用Bootstrap 3.0.0 RC1或RC2.

我的问题:我不知道如何在我自己的托管中使用图标...在我看来代码包含在bootstrap.css(?)中.我已经上传了"fonts"目录,但我只得到空白的空盒子图标,其中应该有适当的图标.

有什么想法吗?应该在哪里以及如何调用它?

Dav*_*ian 10

bootstrap-glyphicons.css文件似乎已被最终的\ production Bootstrap 3.0.0删除.只需从http://getbootstrap.com/下载zip ,然后将dist/css/bootstrap.min.css文件复制到css文件夹中.然后,您应该将其包含在HTML页面中:

<!DOCTYPE html>
<html>
  <head>
    <title>Bootstrap 101 Glyphicons</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Bootstrap CSS file -->
    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">

  </head>
  <body>

    <!-- Glyphicon in a H1 tag -->
    <h1>Hello, <span class="glyphicon glyphicon-globe"></span> !</h1>

  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

资料来源:http://getbootstrap.com/getting-started/


mrk*_*kre 7

如果您已经放入了fonts目录,那么现在调用图标将<span class="glyphicon glyphicon-pencil"></span>代替<i class="icon-large icon-pencil"></i>.

  • 是的,我已经有了fonts目录.我正在使用那种图像调用.但我得到的只是空白框图标.我不明白.据我所知,唯一不同的是我将我的Bootstrap CSS文件存储在不同的文件夹中(/ public_html/wp-content/themes/bs3theme/css/rc2 /),而字体位于/ public_html/wp-content/themes/bs3theme/fonts/ - 但我已将文件路径更改为bootstrap.css中的文件路径. (4认同)