0

Using Bootstrap 4, is possible center any element vertically in the middle of input? (with a simple structure, not a lot of divs)

The first example of https://jsfiddle.net/fekula/8j4ew5df/9/ is more or less good, but the second and third bad

<div class="form-row align-items-end">
   <div class="form-group col-md-7">
    <label>Name:</label>
    <input class="form-control">
  </div>
  <div class="form-group col-md-5">
    <label>
        Center text
    </label>
  </div>
</div>

Any idea? Thanks.

enter image description here

FeKuLa
  • 356
  • 2
  • 10
  • 24

1 Answers1

0

First label is not centered, it has just a bottom margin for default for labels without classes. For example, by adding mb-2 class to the .custom-control.custom-switch element hit the trick.

But you need to put your input[type="text"] in one .row element with labels to centering them verticaly.