是否可以像使用Font Awesome的图标一样使用Bootstrap“堆叠”默认的glyphicons? Glyphicons可以这样做:
http://fortawesome.github.io/Font-Awesome/examples/#stacked还是我必须做自定义编码?
谢谢!
解决方法
Bootstrap的Glyphicons CSS没有要堆叠的类.您可以应用示例代码中的类:
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>