本文介绍了Bootstrap 3:Glyphicons可以像Font Awesome的图标一样堆叠吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以使用Bootstrap堆叠默认字形,就像Font Awesome的图标一样? Can Glyphicons可以做到这一点:或者我必须自定义编码吗?
Is it possible to "stack" the default glyphicons using Bootstrap like you can with Font Awesome's icons? Can Glyphicons do this: http://fortawesome.github.io/Font-Awesome/examples/#stacked or do I have to do custom coding?
谢谢!
推荐答案
Bootstrap的CSS for Glyphicons没有类堆栈。您可以应用示例代码中的类:
Bootstrap's CSS for Glyphicons don't have classes to stack. You could apply the classes from your example code: http://bootply.com/88775
css
.icon-stack {
display: inline-block;
height: 2em;
line-height: 2em;
position: relative;
vertical-align: -35%;
width: 2em;
}
.icon-stack .icon-stack-base {
font-size: 2em;
}
.icon-stack [class^="icon-"], .icon-stack [class*=" icon-"] {
display: block;
font-size: 1em;
height: 100%;
line-height: inherit;
position: absolute;
text-align: center;
width: 100%;
}
.icon-stack .glyphicon{
font-size: 2em;
}
.glyphicon-ban-circle
{
color:red;
}
html
<span class="icon-stack">
<i class="glyphicon glyphicon-phone icon-stack-base"></i>
<i class="glyphicon glyphicon-ban-circle"></i>
</span>
这篇关于Bootstrap 3:Glyphicons可以像Font Awesome的图标一样堆叠吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!