Hello, everyone.
I'm starting with front-end web programming and I have a question regarding Bootstrap 4, and its grid system. Basically how to centralize input
and p
within Grid.
I have the following code:
<div class="container-fluid mt-2">
<div class="row">
<div class="col-md-2 offset-md-1">
<a href="http://placehold.it"><img src="http://placehold.it/200x150"></a></div><divclass="col-md-6 pt-5">
<div class="input-group">
<input type="text" class="form-control">
</div>
</div>
<div class="col-md-3">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</div>
</div>
</div>
What I basically want is to center this input
and p
within the grid, so that it is next to the 200x150 image. (As the image increases, the size of the row
also increases, leaving the other elements at the top). I was able to do this by placing inside the class <div class="col-md-6">
pt-5
, however it gives a padding-top of 5, getting a bit of a "gambiarra" and not centralizing inside the Grid correctly.
I would like to know if there is any way to centralize the input without having to use the pt-5
within the class to make the spacing from the top.
Thank you!