wordpress - 一些 Bootstrap 字形图标未加载

标签 wordpress twitter-bootstrap sass glyphicons bootstrap-sass

我有一个使用 Bootstrap Sass 源代码构建的 WordPress 主题。样式有效,但大多数字形图标都没有(只有星号和加号)。我正在将我的 Bootstrap 编译为 style.css相对于此,有一个名为 fonts 的文件夹包含字形图标(我设置了 $icon-font-path: "fonts/"; )这是我编译的 style.css 的片段显示字体路径正确:

@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.woff2") format("woff2"), 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"); }
.glyphicon { position: relative; top: 1px; display: inline-block; font-family: 'Glyphicons Halflings'; font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

例如,这些工作:
<span class="glyphicon glyphicon-asterisk" aria-hidden="true"></span>
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>

但这些不会:
<span class="glyphicon glyphicon-thumbs-up" aria-hidden="true"></span>
<span class="glyphicon glyphicon-heart" aria-hidden="true"></span>

这是 glyphicon 类的片段:
.glyphicon-asterisk:before { content: "\2a"; }
.glyphicon-plus:before { content: "\2b"; }  
.glyphicon-star:before { content: \e006; }
.glyphicon-thumbs-up:before { content: \e125; }

我检查了网络选项卡以查看它是否正在加载字形字体,并且它们仅在字形工作时出现(星号,加号)。否则,字体文件甚至不会显示在网络选项卡中(甚至没有 404 )。

最佳答案

问题是内容值没有用引号括起来。这仍然是 www.getbootstrap.com 的问题。 sass 源码下载,不过是 recently fixedbootstrap-sass github repo 。

关于wordpress - 一些 Bootstrap 字形图标未加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28267666/

相关文章:

linux - 如何授予关闭用户不允许在 WordPress 中上传照片的权限?

jquery - 如何在 Bootstrap 模式关闭时触发事件

css - 我可以使用 Sass 将样式应用于基于另一个元素上存在的属性的元素吗?

javascript - 汇总、Svelte、SCSS : how to build different bundles at once?

html - Wordpress - 更改自定义基础菜单图标

html - 将搜索框添加到下拉 Wordpress

php - 在 Woocommerce 3 中获取所有运输类别

javascript - 不包含在容器元素中的元素

html - 如何使用 Bootstrap 使谷歌地图全宽?

css - Sass 更改监视间隔,以便更频繁地编译