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.
<button class="btn btn-success btn-lg float-right" type="submit">Submit</button>
Note: Although by default, elements like buttons, are left-aligned still we can use float-left class to mention it specifically. We can also use the class float-none to remove any hierarchical floating.
It is important to note that we are using Bootstrap 4 here, in Bootstrap 3 or Bootstrap 2 we can use the helper classes like pull-left, pull-right to align the elements to the left or right accordingly.
- How to align navbar items to the right in Bootstrap 4 ?
- CSS | text-align Property
- CSS | text-align-last Property
- How to align buttons in Card footer in Bootstrap ?
- How to use Bootstrap to align labels with content into 4 columns ?
- How to Align Navbar Items to Center using Bootstrap 4 ?
- How to Vertically Align Text Next to an Image using CSS ?
- How to Align <legend> Tag Text to Center ?
- How to align Placeholder Text in HTML ?
- How to vertically align text inside a flexbox using CSS?
- Bootstrap 4 | Button Groups
- How to set the button alignment in Bootstrap ?
- How to place button in top Right corner using bootstrap?
- How to enable Bootstrap tooltip on disabled button ?
- How to change (-, +) symbol with a button in Bootstrap Accordion ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.