Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap 3 right align button

I am trying to right align a button in a grid:

enter image description here

I would like the button on the right to align with the text area above it.

My code looks something like this:

<div class="row">
    <div class="col-xs-2">
        Purchase Order
    </div>
    <div class="col-xs-10">
        <textarea />
        <textarea />
        <div class="row">
            <div class="col-xs-9">
                <button />
                <button />
            </div>
            <div class="col-xs-2">
                <button />
            </div>
        </div>
    </div>
</div>

I have tried adding offsets and adjusting the spans of the different columns...the button is either too far to the left or the right. I have tried adding a fixed margin-left to the right button, this works but it breaks the responsive design.


NOTE:

I can't use pull-right, it is deprecated in Bootstrap 3.

like image 823
Musical Shore Avatar asked Feb 16 '16 19:02

Musical Shore


1 Answers

Normally Bootstrap has its own class to pull elements to the right. Try this:

<button class="pull-right">Hello</button> 
like image 63
HoereeBauke Avatar answered Oct 13 '22 19:10

HoereeBauke