html - 如何设置标签的垂直中心和 btn-group Bootstrap

标签 html css twitter-bootstrap

如何使用 bootstrap btn-group 对齐其他元素?

<div class="btn-toolbar text-center">
    <div class="pull-left">
        <span class="glyphicon glyphicon-envelope " style="font-size:1.5em;"></span>
        <label>Title</label>
    </div>
    <div class="btn-group btn-group-sm pull-right">
        <a href="#" title="Open" class="btn btn-default clear-filter"><span class="glyphicon glyphicon-open"></span></a>
        <a href="#" title="Print" class="btn btn-default clear-filter"><span class="glyphicon glyphicon-print"></span></a>
        <a href="#" title="Edit" class="btn btn-default clear-filter"><span class="glyphicon glyphicon-edit"></span></a>
    </div>
</div>

这看起来像,我希望文本和图标是内联的。

Sample image

编辑:

现在文本与按钮内联,但图标不是。

<div class="pull-left">
    <span class="glyphicon glyphicon-envelope " style="line-height: 30px; font-size: 1.5em; vertical-align: middle;"></span>
    <label style="line-height:30px;">Title</label>
</div>

Samlpe image

最佳答案

请试试这个:

.glyphicon {
  position: relative;
  top: -1px;
  display: inline-block;
  font-family: 'Glyphicons Halflings';
  -webkit-font-smoothing: antialiased;
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  vertical-align: middle;
}

关于html - 如何设置标签的垂直中心和 btn-group Bootstrap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36396944/

相关文章:

javascript - Heroku:在 Heroku 上上传静态站点?

css - 图片不会在线显示

html - 将 2 个输入字段与下拉 Bootstrap 对齐

javascript - 如何在 Bootstrap 日期选择器中显示特定月份

javascript - Discover Meteor - mrt add bootstrap - 安装错误

javascript - 在浏览器中播放pls文件

html - 使用单个按钮上传文件

html - 如何使用数字和字母顺序制作嵌套列表

php - 无法将图像放在圆圈内

html - 有一张不会在某些分辨率下显示的图像