form-actions class similar design in twitter bootstrap 3
You can use the form-horizontal
class in bs3 also. However, major change is you have to define col width to the label as well as instead of using form-actions
you can combine more buttons inside col-x-x
class which used as controls
in bs2. Please see this.
<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>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox"> Remember me
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary">Sign in</button> <button type="submit" class="btn btn-default">Cancel</button>
</div>
</div>
</form>
The .form-action
is removed in bootstrap 3. and you can use a form-group
to add the buttons at the end of the form.
You can add more buttons to form-group in the same line:
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="submit" class="btn btn-default btn-lg" value="Save" >
<input type="submit" class="btn btn-default btn-lg" value="Update" >
</div>
</div>
If you want to have some color effect or background color for the buttons, you must consider that the form-group has a left and right margin of -15px.
<div style="background-color: black; margin-left: 0px; margin-right: 0px;" class="form-group">
Please see Bootstrap 3 form and form last row background color