Currently, I'm working on an HTML horizontal form that includes buttons and text inputs. I'm using Bootstrap 3 for this project.
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<form role="form" method="post" class="form-horizontal form" >
<div class="container-fluid">
<div class="row" >
<div class="col-md-12" >
<div class="form-group" >
<label class="col-md-1 control-label" for="username" >User Name</label>
<div class="col-md-6" >
<input class="form-control" type="text" id="username" name="username" />
</div>
</div>
<div class="col-md-offset-1" >
<div class="form-group" >
<button class="btn-warning btn" type="button" id="add" name="add" >Add User</button>
</div>
</div>
</div>
</div>
</div>
</form>
One issue I've encountered is that when I place the buttons inside a form-group, they appear misaligned compared to other components. This seems to be caused by the following CSS:
.form-horizontal .form-group {
margin-right: -15px;
margin-left: -15px;
}
(you can see it in full screen)
I'm looking for suggestions on how to resolve this alignment problem. Should I create a custom class for this purpose?