how to bring the text and button on same line This is the code:
<div class="col-sm-8">
<h4>Edit Post</h4>
<button type="button" class="btn btn-primary" style="display: inline-
block;">Add New</button>
</div>
Bootstrap allows us to align elements by using the utility class float. As we want to align the button to the right side of the text box, we have to use the float-right class.
Answer: Use the text-right Class You can simply use the class . text-right on the containing element to right align your Bootstrap buttons within a block box or grid column. It will work in both Bootstrap 3 and 4 versions.
Use the Bootstrap 4 d-inline-block
class on the heading...
<div class="col-sm-8">
<h4 class="d-inline-block">Edit Post</h4>
<button type="button" class="btn btn-primary">Add New</button>
</div>
Optionally use align-middle
to vertically align with the button.
https://www.codeply.com/go/F2uHcAPvmx
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