Nad*_*han 19 css css3 twitter-bootstrap
请告诉我如何使用bootstrap将此表单"登录"按钮对齐.我厌倦了使用拉右课.但调整大小后我的按钮位置不正确.
<div role="form">
<div class="form-group">
<label>Username</label>
<input type="text" class="form-control"/>
</div>
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control"/>
</div>
<div class="checkbox">
<label>
<input type="checkbox"> Remember Me
</label>
</div>
<button class="btn-info btn">Log in</button>
</div>
Run Code Online (Sandbox Code Playgroud)
Gil*_*mbo 47
您可以text-right先使用,然后将其包装成div如下:
<div class="text-right">
<button class="btn-info btn">Log in</button>
</div>
Run Code Online (Sandbox Code Playgroud)
这是完整的代码
<div role="form">
<div class="form-group">
<label>Username</label>
<input type="text" class="form-control"/>
</div>
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control"/>
</div>
<div class="checkbox">
<label>
<input type="checkbox"/> Remember Me
</label>
</div>
<div class="text-right"> <!--You can add col-lg-12 if you want -->
<button class="btn-info btn">Log in</button>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)

Sug*_*h G 11
pull-right 工作正常
<button class="btn-info btn pull-right">Log in</button>
Run Code Online (Sandbox Code Playgroud)