user2322507
user2322507

Reputation: 141

align buttons - bootstrap 3

Take a look at the below example.

Sample

I am trying to align the Button 1 on the extreme left and Button 2 and Button 3 on the extreme right. Is there a better way to do this rather than offsets.

Upvotes: 0

Views: 49

Answers (2)

user3291093
user3291093

Reputation:

This worked fine for me:

<div class="col-md-4 col-md-offset-6 pull-right">
     <button type="reset" style="float:right;" class="btn btn-default">
        Button 2</button>
     <button type="reset" style="float:right;" class="btn btn-default">
        Button 3</button>
</div>

Here is your updated script:

here

Upvotes: 1

user3728283
user3728283

Reputation:

You just need to add this to the div containing the right buttons:

text-align:right;

You don't need the offset given your current setup because you are using pull-right.

If you want it to behave similarly on small screens, change the col-md to col-xs otherwise the width will default to 100% being a block level element.

Sample with xs: http://www.bootply.com/s8T3y5qJ7c

Upvotes: 2

Related Questions