How can I center my bootstrap form, since everything is on the right, maybe I am placing the size of the cells wrong, this is my code
<form class="form-horizontal" style="margin:0 auto">
<div class="form-group">
<label class="col-lg-8 control-label">Nombres</label>
<div class="col-lg-4">
<input type="text" class="form-control" name="nombre" />
</div>
</div>
<div class="form-group">
<label class="col-lg-8 control-label">Apellidos</label>
<div class="col-lg-4">
<input type="text" class="form-control" name="apellido" />
</div>
</div>
<div class="form-group">
<label class="col-lg-8 control-label">Correo Electrónico</label>
<div class="col-lg-4">
<input type="text" class="form-control" name="email" />
</div>
</div>
<div class="form-group">
<label class="col-lg-8 control-label">Teléfono Celular</label>
<div class="col-lg-4">
<input type="text" class="form-control" name="telefono_cel" />
</div>
</div>
<div class="form-group">
<div class="">
<button type="submit" class="btn btn-success left">Registrarse</button>
</div>
</div>
</form>
You can try as follows:
or this way
Hope this can help you
With your code it is just a matter of playing with the Bootstrap grids, so I put all the columns in 4 to give it the centering effect although you can also use the class
col-lg-offset-2
in eachlabel
or you can use column orderingTry to apply the alignments that bootstrap has, they are very useful, you just have to place the class in the element that you want to align, something like this:
I hope it works for you.