我下载了引导3.0,但无法让象形文字工作。我得到一些"E003"错误。知道为什么会这样吗?我在本地和网上都试过了,还是遇到同样的问题。


当前回答

这是由于bootstrap.css和bootstrap.min.css中的错误编码。当你从定制器下载Bootstrap 3.0时,以下代码是缺失的:

@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.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
}

因为这是使用Glyphicons的主要代码,所以它不会在ofc…

从完整的包中下载css文件,这段代码将被实现。

其他回答

我也遇到了同样的问题,浏览器无法找到字体文件,我的问题是由于我的.htaccess文件中排除了不应该发送到index.php进行处理的白名单文件。由于字体文件无法加载,字符被BLOB替换。

RewriteCond %{REQUEST_URI} !\.(jpg|png|gif|svg|css|js|ico|rss|xml|json)$
RewriteCond %{REQUEST_URI} !-d
RewriteRule ^ index.php [L,QSA]

如您所见,像图像、rss和xml这样的文件被排除在重写之外,但是字体文件是.woff和.woff2文件,因此这些文件也需要添加到白名单中。

RewriteCond %{REQUEST_URI} !\.(jpg|png|gif|svg|css|js|ico|rss|xml|json|woff|woff2)$
RewriteCond %{REQUEST_URI} !-d
RewriteRule ^ index.php [L,QSA]

将woff和woff2添加到白名单中可以加载字体文件,并且字形应该正确显示。

我也遇到了同样的问题,CSS很好,没有任何问题。 它还包含了所有的字体。

但是这个问题在我安装了“glyphicons- hallings -regular.ttf”后才得到解决,我开始在UI上正确地获得图标。

下载完整/非定制包从那里的网站和替换您的字体文件与非定制包字体。意志是固定的。

-如果你选择了评分最高的答案,但仍然不起作用:

字体文件夹必须与CSS文件夹在同一级别。修复bootstrap.css中的路径将不起作用。

Bootstrap.css必须像这样导航到Fonts文件夹:

@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.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}

我只是用Ctrl+c, Ctrl+v重命名了bootstrap.css的字体,它工作了。