Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter bootstrap 将Glyphicon添加到每个按钮(bootstrap 3.5)_Twitter Bootstrap_Twitter Bootstrap 3_Glyphicons - Fatal编程技术网

Twitter bootstrap 将Glyphicon添加到每个按钮(bootstrap 3.5)

Twitter bootstrap 将Glyphicon添加到每个按钮(bootstrap 3.5),twitter-bootstrap,twitter-bootstrap-3,glyphicons,Twitter Bootstrap,Twitter Bootstrap 3,Glyphicons,我想在所有默认按钮的文本后添加一个字形图标 我在这里找到了如何在列表中包含glyphicon: 我试着把这个应用到按钮上,但我没有做对 .btn-default button:after { content: "\e080"; font-family: 'Glyphicons Halflings'; font-size: 9px; float: left; margin-top: 4px; margin-left: -17px; colo

我想在所有默认按钮的文本后添加一个字形图标

我在这里找到了如何在列表中包含glyphicon:

我试着把这个应用到按钮上,但我没有做对

.btn-default button:after {
    content: "\e080";
    font-family: 'Glyphicons Halflings';
    font-size: 9px;
    float: left;
    margin-top: 4px;
    margin-left: -17px;
    color: #0099FF;
}
我意识到我可以这样添加:

<a class="btn btn-default" href="testpage.aspx">
    Learn more
    <span class="glyphicon glyphicon-chevron-right"></span>
</a>


但我不想每次都加上它。我还想设置颜色。

我知道这是正确的做法:

<span class="glyphicon glyphicon-chevron-right"></span> 

我想你可能需要上面的图像输出为您的所有按钮

为此,您只需编写简单的css:after类css,即可应用于文本之后的所有默认按钮:

.btn-default:after {
    content: "\e080";
    font-family: 'Glyphicons Halflings';
    font-size: 9px;
    vertical-align: middle;
    padding: 6px 5px;
    color: #0099FF;
}
这将适用于您的所有按钮,如图所示

.btn-default:after {
    content: "\e080";
    font-family: 'Glyphicons Halflings';
    font-size: 9px;
    vertical-align: middle;
    padding: 6px 5px;
    color: #0099FF;
}