Bootstrap 3:Glyphicons 可以像 Font Awesome 的图标一样堆叠吗? [英] Bootstrap 3: Can the Glyphicons be stacked like Font Awesome's icons?

查看:22
本文介绍了Bootstrap 3:Glyphicons 可以像 Font Awesome 的图标一样堆叠吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以像使用 Font Awesome 的图标一样使用 Bootstrap 来堆叠"默认字形?Glyphicons 可以这样做吗:http://fortawesome.github.io/Font-Awesome/examples/#stacked 还是我必须进行自定义编码?

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 的 Glyphicons CSS 没有要堆叠的类.您可以应用示例代码中的类:http://bootply.com/88775

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 的图标一样堆叠吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆