我在徽章中使用了一个glyphicon,我希望glyphicon的字体大小比文本小。这样可以正常工作,但现在字形不会在徽章中垂直居中。
当我尝试给它一个边距底部或填充底部时,它会将其添加到整个徽章,而不仅仅是glyphicon元素。
这是我使用的.css课程:
.glyphicon-test3 {
margin-right: 5px;
font-size: 6px;
padding-bottom: 8px;
}
这是HTML:
<div>
<span id="test" class="badge">
<span class="glyphicon glyphicon-plus-sign glyphicon-test3"></span>
Small icon with padding
</span>
</div>
我制作了一个PLNKR,展示了它的全部荣耀:http://plnkr.co/edit/VBIeaffmFujY2qcdPcVI
有什么想法吗?
答案 0 :(得分:0)
你的部分问题是glyphicon类指定的“top:1px”。如果你也覆盖它会更好一点(0,甚至更好-1)。您可能还想玩线高(也是1)。
答案 1 :(得分:0)
只需添加library(data.table)
setDT(df1)[order(Idx), {ind <- which.max(Var1)
ind2=which.min(Var1[seq(ind)])
list(min=Var1[ind2],
max=Var1[ind],
length=Idx[ind]-Idx[ind2]+1)} , Group]
# Group min max length
#1: 1 3 7 3
#2: 2 5 11 4
并覆盖现有的top:-1px
至top: 1px
选择器
.glyphicon
所以
.glyphicon {
position: relative;
top: 1px; <<<This causing the problem
display: inline-block;
font-family: "Glyphicons Halflings";
font-style: normal;
font-weight: 400;
line-height: 1;
}
注意:我删除了填充并添加了高度
答案 2 :(得分:0)
在我的CSS中,这对我有用。 GL
new img[variable]()