21

I've using Twitter bootstrap and trying to align the navbars' text to the right, i.e - that the "brand" will appear on the right, and all else to the left of it. (For right-to-left website).

Any ideas how this can be accomplished?

Zeinab
  • 389
  • 4
  • 14
Roman
  • 4,443
  • 14
  • 56
  • 81

6 Answers6

18

pull-right and pull-left are default bootstrap classes that can help you achieve that without having to write your own css. For example,

    <div class="navbar pull-right"></div> [equivalent to float:right]
    <div class="navbar pull-left"></div>  [equivalent to float:left]
Rajarshi
  • 381
  • 3
  • 10
13

Apply float:right to div with class as navbar-inner

<div class="navbar-inner" style="float:right">  

Like

<div class="navbar">
    <div class="navbar-inner">    
        <div style="float:right">
        <a class="brand" href="#">Title</a>
        <ul class="nav">
        <li class="active"><a href="#">Home</a></li>
        <li><a href="#">Link</a></li>
        <li><a href="#">Link</a></li>
        </ul>
    </div>
</div>

Live Demo

Ajinkya
  • 22,324
  • 33
  • 110
  • 161
  • Just for future reference - After this edit, the order of the items should be reversed (such as the ".brand" should be the last in the div now) – Roman Dec 24 '12 at 13:21
  • 1
    @roman: If you want to update the order just update the order in `
  • ` accordingly.
  • – Ajinkya Dec 24 '12 at 13:23