Twitter bootstrap 将Glyphicon添加到每个按钮(bootstrap 3.5)
我想在所有默认按钮的文本后添加一个字形图标 我在这里找到了如何在列表中包含glyphicon: 我试着把这个应用到按钮上,但我没有做对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
.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;
}