首页 > boostrap Glyphicons 字体问题

boostrap Glyphicons 字体问题

我按照网上的教程想要使用 boostrap Glyphicons,也拷贝fonts文件夹到目录下,下面是我的html文件,但是当我把fonts移到上一级目录就可以了,是为什么呢
sidebar.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="author" content="Quoniam">
    <title>SidebarMotion</title>
    <link rel="stylesheet" href="bootstrap.min.css">
    <script src="jquery-2.1.4.min.js"></script>
    <script src="bootstrap.min.js"></script>
</head>
<body>
    <div id="sidebar">
        <ul>
            <li class="item" id="prof">
                <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
                <div>我</div>
            </li>
        </ul>
    </div>
</body>
</html>

但是结果如下是为什么:

我的文档结构

├── bootstrap.min.css
├── bootstrap.min.js
├── bootstrap-theme.min.css
├── fonts
│   ├── glyphicons-halflings-regular.eot
│   ├── glyphicons-halflings-regular.svg
│   ├── glyphicons-halflings-regular.ttf
│   ├── glyphicons-halflings-regular.woff
│   └── glyphicons-halflings-regular.woff2
├── jquery-2.1.4.min.js
└── sidebar.html

一楼正解,bootstrap里面坑就是这么多,用别人的东西就凡事得照着他的来


确实,应该是CSS里找不到图标字体了。


因为看不到你的font-face的路径,目测你的目录结构错了,bootstrap.min.css默认是放在css目录下的,所以css文件中默认的font-face路径是../fonts/glyphicons-halflings-regular.xxx,所以尝试修改一下font-face的路径或者bootstrap.min.css文件放到css目录中

【热门文章】
【热门文章】