Hmmm...to be honest, I didn't find a good workaround aside from partially overriding the Twitter Bootstrap CSS. The issue is that the width of a responsive .span4
(the element your form is contained in) can end up being much smaller than the combined, hard-coded widths and margins of the <label>
and <input>
elements in the form.
These elements do have an alternate layout, where the <label>
stacks above the <input>
, which would fit adequately inside a .span4
. However, this CSS is not applied until a sufficiently narrow screen width is reached, via media query. (If you make the screen much narrower, you'll see this change happen.)
You could write another media query that applies these styles at a different screen width (for when the viewport is still pretty wide, but the .span4
is too narrow), but since you don't want to bother too much with those, I went down a different route.
So the definitions I added to your overriding CSS were:
.form-horizontal .control-label{
text-align:left;
padding-top: 5px;
margin-right:20px;
width:80px;
}
.form-horizontal .controls{
float:left;
margin-left: 0;
}
You'll note that this removes/overrides a lot of the extra width and margins I mentioned earlier. So, your form will end up looking a bit different (the extra space on the left is gone, and a bit of text alignment was changed). Now though, the elements will collapse into a "small-screen" layout relative to the narrowness of their parent, rather than to that of the viewport. Of course, feel free to not use this solution if you feel that the design alterations outweigh the responsiveness.
If this isn't what you were looking for, let me know and I'll be happy to help further. Good luck!