3

It may be stupid but I do not have any idea how to make bootstrap navbar from right to left, I'm creating an arabic website, so i want to have 'home' nav from the right .

here is my code :

<div class="navbar-collapse collapse">
                <ul class="nav navbar-nav navbar-right">
                    <li class="current"><a href="#home">Home</a></li>
                    <li><a href="#about">About</a></li>
                    <li><a href="#our-menu">Menu</a></li>
                    <li><a href="#contact">Contact</a></li>
                </ul>
</div>

I tried pull righ and dir=ltr but it does not work Thanks in advance .

phoenix
  • 127
  • 1
  • 10

3 Answers3

6

The li are floated left by default.

Just change that to float:right

.navbar-nav>li {
    float: right
}

Codepen Demo

Paulie_D
  • 107,962
  • 13
  • 142
  • 161
3

There is a library for this http://cdnjs.com/libraries/bootstrap-rtl

I found this by googling "bootstrap right to left language" and it took me here Right to Left support for Twitter Bootstrap 3

Community
  • 1
  • 1
Andrew Bone
  • 7,092
  • 2
  • 18
  • 33
0

You simply need to add the following CSS code inside your navbar's ul element.

ul.nav {
    direction: rtl;
}

Example here: http://jsfiddle.net/fs9fafjq/

Valentin Mercier
  • 5,256
  • 3
  • 26
  • 50