引导程序与行中的表单内嵌向右对齐

时间:2019-02-05 15:55:34

标签: html bootstrap-4

情况如何:

enter image description here 应该如何:

enter image description here

当前第二个组件被向右推,但是其内容向左对齐。我试图添加float-right类,但是没有用。

<div class="container">
  <form class="form-row">
    <div class="col-md-3">
     Some component here
    </div>
    <!--Content of this element should be aligned to right-->
    <div class="col-auto ml-auto">
      <div class="form-inline">
        <label>Some label</label>
        <input class="form-control" readonly>
      </div>
      <div class="form-inline">
        <label>Other longer label</label>
        <input class="form-control" readonly>
      </div>
    </div>
  </form>
</div>

1 个答案:

答案 0 :(得分:0)

我已将 <div class="container full-width--true"> // My full-width container </div> 添加到后面的元素style="display: flex; justify-content: flex-end"中,并且按我的意愿工作了。