【发布时间】:2013-11-05 16:41:00
【问题描述】:
我之前没有使用过任何引导框架。我想在我的页面上的 bootstrap 3 中包含一些字形图标。据我了解,它们应该包含在我添加到页面的 bootstrap.css 文件中。当我查看 bootstrap.css 文件时,我没有看到对它们的任何引用?虽然它是一个大文件,但我可能错过了一些东西。
我注意到,当我打开从 bootstrap 3 下载的 dist 文件夹时,有一个单独的文件夹 fonts 包含名为:
glyphicons-halflings-regular.eot
glyphicons-halflings-regular.svg
glyphicons-halflings-regular.ttf
glyphicons-halflings-regular.woff
这似乎是字形图标所在的位置,但我不知道如何将这些附加到我的网站?如何将字形图标附加到我的页面?
提前感谢您的帮助
下面的代码显示了附加的 bootstrap.css 文件:
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap example</title>
<meta name="viewport" content="width=divice-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="bootstrap.css" rel="stylesheet" media="screen">
</head>
这里是html 代码的一部分,显示了字形图标的位置:
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#"><span class="glyphicon glyphicon-home"></span>
Home</a></li>
<li><a href="#"><span class="glyphicon glyphicon-star"></span> Top
Destinations</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span
class="glyphicon glyphicon-user"></span> About Us<b class="caret"></b></a>
【问题讨论】:
-
查看字体文件的保存位置 (getbootstrap.com/getting-started/#whats-included-precompiled) 并了解导入顺序 (github.com/twbs/bootstrap-sass#fonts) 帮助了我。
标签: html css twitter-bootstrap-3 directory