I'm working with Bootstrap 4.0 and I'm trying to put together a form-row
that has two columns, on the left a input
and on the right a custom-control-input
of type checkbox
.
My problem is that I can not vertically center the elements of the right column, looking in the documentation of the forms makes use of the class align-items-center
along with form-row
, but apparently, it only applies using form-group
, not with input-group
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<form>
<div class="form-row">
<div class="col-6">
<label class="col-form-label col-form-label-sm" for="ruedas">Ruedas</label>
<div class="input-group input-group-sm ">
<input type="text" id="ruedas" class="form-control">
<div class="invalid-feedback">Error de validación proporcionado por el backend</div>
</div>
</div>
<div class="col-6">
<div class="custom-control custom-checkbox mt-3">
<input type="checkbox" class="custom-control-input" id="tieneRuedasAisladas">
<label class="custom-control-label" for="tieneRuedasAisladas">¿Tiene Ruedas Aisladas?</label>
</div>
</div>
</div>
</form>
Is there a Bootstrap method to solve this? I tried to play with the margin classes m-*
, but I could not reach a result that was accurate enough
Thanks for the time!