3

I need to put element to the right side of page.

This element:

element

To the right side of page. Like this:

enter image description here

I found only pull-right helper class, but I have been realizing, it wouldn't help me, because it based on float. So I started research and first result in google is this result. It says, that I should use pull-right. Well, I tried...

I tried this:

<a href="#" class="btn btn-default btn-lg pull-right" role="button"><span class="glyphicon glyphicon-plus"></span> Создать заказ</span></a>

I got this obvious result:

enter image description here

You can see that third heading in upper row is displaced.

So what exactly I need to do right align any element using bootstrap api?

I understand, that I can search how to center/left/right div and I will find some working results, but it will be not bootstrap solution.

Community
  • 1
  • 1
Sharikov Vladislav
  • 7,049
  • 9
  • 50
  • 87

1 Answers1

4

I think your answer is ".pull-right" class. You may look at it Bootstrap 3 Documentation Helper Classes. I think you can use 2 methods for this.

1) For amateurs :

<div class="col-sm-8"></div> /*Empty div for left alignment*/
<div class="col-sm-4"><div class="btn btn-default">Your Text on Button</div></div> /*This is your button*/

After this code you can use your headings. I mean your button and your heading have to apart from each other.

But as I said this is really terrible for you. And I think it will occur some problem for responsive design.

2)This is for pro Bootstrappers

<div class="col-xs-12"><div class="btn btn-default pull-right>Your Button Text</div></div>

Again after this code you can use your headings. I mean your button and your heading have to apart from each other. You should have to get attention on ".pull-right" class. You just use it on the right place.

I think this will be work for you!

Maybe you want to look at it : How can I get my Twitter Bootstrap buttons to right align?

Community
  • 1
  • 1
Emre Doğan
  • 137
  • 2
  • 11