如何在 Bootstrap 中创建带有关闭图标的标签? [英] How to create a Label with close icon in Bootstrap?
本文介绍了如何在 Bootstrap 中创建带有关闭图标的标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用 Bootstrap 3,获得带有关闭图标的带边框标签的好方法是什么?Stack Overflow 中的一个例子:
With Bootstrap 3, what might be a good way of getting a bordered label with close icon? An example of the sort of thing from Stack Overflow:
推荐答案
我最终得到了 http://jsfiddle.net/7zkCU/30/(改编自 http://maxwells.github.io/bootstrap-tags.html):
I ended up with http://jsfiddle.net/7zkCU/30/ (adapted from http://maxwells.github.io/bootstrap-tags.html):
<span class="tag label label-info">
<span>Example Tag</span>
<a><i class="remove glyphicon glyphicon-remove-sign glyphicon-white"></i></a>
</span>
CSS:
.tag {
font-size: 14px;
padding: .3em .4em .4em;
margin: 0 .1em;
}
.tag a {
color: #bbb;
cursor: pointer;
opacity: 0.6;
}
.tag a:hover {
opacity: 1.0
}
.tag .remove {
vertical-align: bottom;
top: 0;
}
.tag a {
margin: 0 0 0 .3em;
}
.tag a .glyphicon-white {
color: #fff;
margin-bottom: 2px;
}
这篇关于如何在 Bootstrap 中创建带有关闭图标的标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文