jquery - Bootstrap Glyphicons 更改按钮上的字体系列

标签 jquery html css twitter-bootstrap fonts

我已经使用 Bootstraps Glyphicons 几天了,我尝试在带有 glyphicon 图标的按钮中添加一些文本:

<button type="button" class="btn btn-default pull-left" data-toggle="collapse" data-bind="attr:{'href':'#'+'TableA'}">
     <span class="glyphicon glyphicon-th-list" aria-hidden="true" data-bind="text:' Details'"></span>
 </button> 

点击它会显示一个表格。我需要将文本设为 Arial,但如果我在 bootstrap.css 中更改它或添加:

<span class="glyphicon glyphicon-download-alt" aria-hidden="true" data-bind="text:' Download', style:{fontFamily: 'Arial'}"></span>

它将文本字体系列更改为 Arial,但字形图标消失了。 我究竟做错了什么?可以更改带有字形图标的按钮内文本的字体系列吗?

最佳答案

字体在我扩展短<span/>后修复了扩展的定义 ( <span></span> )。

原版(字体无效):

        <button type="button" class="btn btn-default">
            <span class="glyphicon glyphicon-send"/>
            &nbsp;Send message
        </button>

固定版本:

        <button type="button" class="btn btn-default">
            <span class="glyphicon glyphicon-send"></span>
            &nbsp;Send message
        </button>

我真的不明白为什么这对我有用......

关于jquery - Bootstrap Glyphicons 更改按钮上的字体系列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32821616/

相关文章:

javascript - 将函数用作 "on"事件?

javascript - 在加载时而不是在悬停时更改 div 宽度

jquery - 单击阅读更多时,我有一个展开的 div,想要一个关闭链接吗?

javascript - 在 IE/FireFox/Chrome 中横向打印 DIV

html - 选择 div 中的最后两个元素,但如果只有两个则不选择

javascript - 如果存在则删除类并使用 jquery 添加新的类

javascript - Firefox 不会重置 jquery 创建的元素

javascript - 将用户输入推送到本地存储阵列

asp.net - 在 JavaScript 中禁用表

jquery - 尝试在没有倾斜文本的情况下实现倾斜菜单项。接近了,但 2 层元素正在奇怪地层叠