html - bootstrap 表单-水平左对齐

标签 html

谁能告诉我如何将用户名标签左对齐。

<form class="form-horizontal">
    <div class="form-group">
        <label class="control-label col-sm-3" for="username">Username</label>
        <div class="col-sm-9">
            <input type="text" class="form-control" id="username" placeholder="Enter username">
        </div>
    </div>
</form>

最佳答案

需要移除form-horizo​​ntal

<form >
    <div class="form-group">
        <label class="control-label col-sm-3"for="username">Username</label>
        <div class="col-sm-9">
            <input type="text" class="form-control" id="username" placeholder="Enter username">
        </div>
    </div>
</form>

Note:if you want any text-left or right then use text-left or text-right class but your code will work fine without these classes.

阅读本文档

http://getbootstrap.com/css/

您可以进一步使用 grid-framework.less 文件作为您的 View ,它将按行管理数据(以便更好地控制)

关于html - bootstrap 表单-水平左对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41281539/

相关文章:

css - 如何向圆环图的每个切片添加弹出窗口或工具提示

javascript - 使用 jQuery 从表中删除行

html - 居中基于百分比的div

html - 如何使用 TailwindCSS 设置每个单元格具有特定宽度和高度的网格样式

javascript - jquery附加图像然后将它们放入轮播中

javascript - 显示从 JSON 对象检索到的预格式化 html 内容

html - 在 div 问题中将边距设置为单个 header 标签

html - CSS渐变: simulate progress bar

javascript - 如何用html5制作播放按钮?

html - 导航栏右侧的 ionic 对齐图标