我正在为我的网页使用自定义字体。不幸的是它不是标准字体并且它的偏移量不正确。当我将这种字体与 twitter bootstrap glyphicon 一起使用时,它们不会出现在同一行中。
如何将字形移低一点?或者还有其他好的解决方案来解决这个问题吗?
<li><a href="#"><span class="glyphicon glyphicon-log-out"></span> My Text</a></li>
最佳答案
您可以使用简单的 css 移动位置。使用像 em
这样的相对单位应该适用于所有字体大小。您可能需要设置更多规则并使用 px
进行像素完美对齐。
.glyphicon {
top: 0.5em;
}
.glyphicon {
top: 0.5em !important;
/* You can omit `!important` if you include your css after the glyphicon css */
}
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"/>
<ul>
<li><a href="#"><span class="glyphicon glyphicon-log-out"></span> My Text</a></li>
</ul>
关于html - 降低字形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25922030/