我需要将button
与输入字段对齐。
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<form>
<div class="form-group col-lg-6">
<label for="email">Nome:</label>
<input type="email" class="form-control" id="email">
</div>
<div class="form-group col-lg-6">
<label for="pwd">CNPJ:</label>
<input type="password" class="form-control" id="pwd">
</div>
<div class="input-group-btn">
<button type="submit" class="btn btn-default">Submit</button>
</div>
</form>
有什么想法吗?感谢。
答案 0 :(得分:1)
只需将班级col-lg-6
添加到按钮div:
<div class="input-group-btn col-lg-6">
<button type="submit" class="btn btn-default">Submit</button>
</div>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<form>
<div class="form-group col-lg-6">
<label for="email">Nome:</label>
<input type="email" class="form-control" id="email">
</div>
<div class="form-group col-lg-6">
<label for="pwd">CNPJ:</label>
<input type="password" class="form-control" id="pwd">
</div>
<div class="input-group-btn col-lg-6">
<button type="submit" class="btn btn-default">Submit</button>
</div>
</form>
&#13;