I\'m using Bootstrap for the first time, and am having a lot of trouble aligning this form-horizontal to the left.
The list items are horizontal, as they should be, but
"pull-left" is what you need, it looks like you are using Bootstrap 2, I am not sure if that is available, consider bootstrap 3, unless ofcourse it is a huge rework! ... for Bootstrap 3 but you need to make sure you have 12 columns in each row as well, otherwise you will have issues.
If you are saying that your problem is how to left align the form labels, see if this helps:
http://jsfiddle.net/panchroma/8gYPQ/
Try changing the text-align left / right in the CSS
.form-horizontal .control-label{
/* text-align:right; */
text-align:left;
background-color:#ffa;
}
Good luck!
I was having the exact same problem. I found the issue within bootstrap.min.css. You need to change the label:
label {display:inline-block;}
to label {display:block;}
Just add style="text-align: left"
to your label.
Just my two cents. If you are using Bootstrap 3 then I would just add an extra style into your own site's stylesheet which controls the text-left
style of the control-label
.
If you were to add text-left
to the label, by default there is another style which overrides this .form-horizontal .control-label
. So if you add:
.form-horizontal .control-label.text-left{
text-align: left;
}
Then the built in text-left
style is applied to the label correctly.
Instead of altering the original bootstrap css class create a new css file that will override the default style.
Make sure you include the new css file after including the bootstrap.css file.
In the new css file do
.form-horizontal .control-label{
text-align:left !important;
}