html - Bootstrap : how to move label to the right of the input in form-horizontal?

标签 html css twitter-bootstrap

好吧,我正在尝试使用 Bootstrap 在输入的右侧设置标签,但我无法管理它。 我在互联网上搜索并尝试了几段代码,但没有任何效果......

在此link标签在右边,但我不知道该怎么做。

Fiddle code

<form class="form-horizontal">
<fieldset>

<!-- Form Name -->
<legend>Align Label Form</legend>

<div class="col-sm-6"><!-- Text input-->
<div class="form-group">
  <label class="col-sm-4 control-label" for="textinput">Left Align</label>
  <div class="col-sm-6">
    <input id="textinput" name="textinput" placeholder="placeholder" class="form-control input-md" type="text">
  </div>
</div>
</div>
<div class="col-sm-6"><!-- Text input-->
<div class="form-group">
  <label class="col-sm-4 control-label" for="textinput">Right Align</label>
  <div class="col-sm-6">
    <input id="textinput" name="textinput" placeholder="placeholder" class="form-control input-md" type="text">
  </div>
</div>
</div>
</fieldset>
</form>

enter image description here

最佳答案

只需在输入后放置标签即可。喜欢:

<div class="col-sm-6">
    <input id="textinput" name="textinput" placeholder="placeholder" class="form-control input-md" type="text">
</div>
<label class="col-sm-4 control-label" for="textinput">Right Align</label>

关于html - Bootstrap : how to move label to the right of the input in form-horizontal?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48305082/

相关文章:

.net - 自动宽度和溢出 div

html - 使 ul 列表彼此并排

javascript - 使用 JavaScript 更改元素的类时,CSS 类中定义的过渡属性不会生效

html - 我没有重复背景图片,但如何拉伸(stretch)图 block ?

javascript - Bootstrap 3 菜单 - 两个折叠按钮 - 一次只打开一个

jquery - 正确切换类

html - 无法在 'postMessage' : Invalid target origin 上执行 'Window'

javascript - 在滚动上使用 javascript 动画图像序列

css - 如何使用 less 在 bootstrap 中定义网格布局?

jquery - 无法初始化 bootstrap-datepicker