Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you properly align right a toolbar in Bootstrap?

When you have a toolbar with a few buttons and a drop down, like this one:

<div class="container">
    <div class="btn-toolbar" role="toolbar">
        <div class="btn-group"><a class="btn btn-default" role="button" href="">Invite People</a></div>
        <div class="btn-group"><a class="btn btn-default" role="button" href="">Create Campaign</a></div>
        <div class="btn-group"><a class="btn btn-default" role="button" href="">Edit</a></div>
        <div class="btn-group">
            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">Action <span class="caret"></span></button>
            <ul class="dropdown-menu" role="menu">
                <li><a href="#">Action</a></li>
                <li><a href="#">Another action</a></li>
                <li><a href="#">Something else here</a></li>
            </ul>
        </div>
    </div>
</div>

How do you properly align it right? I tried pull-right on the toolbar as well as the button groups as well as one button group with pull-right containing all the buttons. None of those worked.

like image 877
pupeno Avatar asked Apr 15 '15 08:04

pupeno


People also ask

How do I right align Bootstrap?

Using .align-self-end is used to align a single item in a Flexbox to the right.

How do you align buttons to the right?

If you want to move the button to the right, you can also place the button within a <div> element and add the text-align property with its "right" value to the "align-right" class of the <div>.

How do I align a search box to the right in Bootstrap 4?

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.


1 Answers

Try like this: DEMO

<div class="container">
    <div class="btn-toolbar pull-right" role="toolbar">
.....
</div></div>

Bootstrap pull-right is working fine here.

like image 129
G.L.P Avatar answered Nov 15 '22 04:11

G.L.P