四列水平形式,bootstrap 3

时间:2014-01-09 13:22:10

标签: css twitter-bootstrap

我有这种横向形式(来自文档示例)。

我想在标签前添加radiobutton,并在右侧添加一个Dropbox。所以我需要一个四(对齐)列水平形式。这是最好的方法吗?

<form class="form-horizontal" role="form">
  <div class="form-group">
    <label for="inputEmail3" class="col-sm-2 control-label">Email</label>
    <div class="col-sm-10">
      <input type="email" class="form-control" id="inputEmail3" placeholder="Email">
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Password</label>
    <div class="col-sm-10">
      <input type="password" class="form-control" id="inputPassword3" placeholder="Password">
    </div>
  </div>
</form>

1 个答案:

答案 0 :(得分:0)

radio and drop-down next to label

将表单类型更改为form-inline

在任何label之前,只需执行此操作:

   <input type="radio" class="" placeholder="" name="radio_btn" />

   <label for="inputEmail3" class="col-sm-2 control-label inline-show ">Email</label>

   <select>
     <option>1</option>    
     <option>1</option>    
     <option>1</option>
   </select>