中心Twitter Bootstrap 3 Glyphicons在按钮 [英] Center Twitter Bootstrap 3 Glyphicons in buttons

查看:136
本文介绍了中心Twitter Bootstrap 3 Glyphicons在按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在使用Twitter Bootstrap 3 RC2以及已经移动到单独的存储库的Twitter Bootstrap。我注意到,如果在带有文本的按钮中使用,图标不会居中:

I am now using Twitter Bootstrap 3 RC2 as well as Twitter Bootstrap which has moved into a separate repository. I have noticed, if used in a button with text the icon is not centered very well:

图标和文字有相同的底线,但我相信一个好看的按钮的图标应该以文本为中心,不应该吗?任何想法如何实现这一点?

The icon and the text have the same bottom line, but I believe for a good looking button the icon should be centered based on the text, shouldn't it? Any idea how to achieve this?

http:// bootply。 com / 74652

推荐答案

将文本移出< span> 与字形并将 vertical-align:middle 应用于< span>

Move the text out of the <span> with the glyphicon and apply vertical-align:middle to the <span>

  <button class="btn btn-default">
    <span class="glyphicon glyphicon-th" style="vertical-align:middle"></span> Centered
  </button>

演示

Demo

这篇关于中心Twitter Bootstrap 3 Glyphicons在按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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