4

I have a navigation bar that looks like this:

<nav class="navbar navbar-default">
<div class="container-fluid">
        <ul class="nav navbar-nav">
            <li class="active"><a href="#">Hello</a></li>
            <li><a href="#">About Me</a></li>
            <li><a href="#">Portfolio</a></li>
            <li><a href="#">Blog</a></li>
            <li><a href="#">Contact</a></li>
        </ul>
</div>

I just wanted to center the items in the list. I tried:

.navbar-default {
  width: 100%;
  text-align: center;
}

But no luck.

Dikshant Adhikari
  • 664
  • 1
  • 10
  • 24

2 Answers2

3

that should help you margin:0 auto;

yahoo5000
  • 470
  • 6
  • 18
1

You can set margin:0 auto; to the navbar style as the other answer suggests, or you can also add the bootstrap container class to it which basically does the same thing for you.

Prahlad Yeri
  • 3,567
  • 4
  • 25
  • 55