I host coding and preview here.
I would like to right-align my 2nd button, please show me how to do that.
Thanks.
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.
ml-auto class in Bootstrap can be used to align navbar items to the right. The . ml-auto class automatically aligns elements to the right.
Check demo
.navbar-header{ margin-left:5px; width:100%; }
And add
pull-right
class to your button.
For Bootstrap 3, .navbar-right
does just that.
<ul class="nav navbar-nav navbar-right"> . . </ul>
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