Bootstrap - 将网格col对齐到中间和左侧的垂直对齐

时间:2013-09-10 18:54:41

标签: twitter-bootstrap

我有一个有一行和两列的网格,我需要的是将span3放在列的中间。

这是我现在的结果:enter image description here

HTML

<div class="container">
  <div class="row index">

    <div class="col-lg-2">
      <h3>Para receber:</h3>
    </div>

    <div class="col col-lg-10">
      <div class="span3">
        <button type="button" class="btn btn-warning btn-sm">Hoje</button>
        <button type="button" class="btn btn-warning btn-sm">Na Semana</button>
        <button type="button" class="btn btn-warning btn-sm">No Mês</button>
        <button type="button" class="btn btn-danger btn-sm">Somente Atrasados</button>
      </div>
    </div>
  </div><!-- /.row -->
<div/>

1 个答案:

答案 0 :(得分:0)

我找到的解决方案是创建一个带有表单组的表单,并在按钮上添加标签。

<div class="col-lg-12">

      <form class="form-inline" role="form">
        <div class="form-group">
          <label>Para Receber: </label>
          <button type="button" class="btn btn-warning btn-sm">Hoje</button>
          <button type="button" class="btn btn-warning btn-sm">Na Semana</button>
          <button type="button" class="btn btn-warning btn-sm">No Mês</button>
          <button type="button" class="btn btn-danger btn-sm">Somente Atrasados</button>
        </div>

      </form>

    </div><!-- /.col-lg-12 -->