I have 3 elements and I am trying to align the button to the right side of the screen, but am having trouble doing so.
<div class="container"> <div class="row-fluid"> <h4> <img src="img.png" style="width:50px;"> Title <a href="link_to_img.html" class="btn btn-success">Grab it!</a> </h4> </div> </div>
One way to vertically center is to use my-auto . This will center the element within it's flexbox container (The Bootstrap 4 . row is display:flex ). For example, h-100 makes the row full height, and my-auto will vertically center the col-sm-12 column.
Use CSS property to set the height and width of div and use display property to place div in side-by-side format. float:left; This property is used for those elements(div) that will float on left side. float:right; This property is used for those elements(div) that will float on right side.
Try the class 'pull-right'.
<div class="pull-right">...</div>
See http://getbootstrap.com/css/#helper-classes-floats
try something like this
<a href = "link_to_img.html" class = 'btn btn-success pull-right'>Grab it!</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With