I\'m using twitter bootstrap to create togglable tabs. Here is the css I\'m using:
&
Adding the class nav-justified
works for me. This not only center aligns the tabs but it also spreads them nicely at the top.
<ul class="nav nav-tabs nav-justified">
<li><a href="#Page1">Page1</a></li>
<li><a href="#Page2">Page2</a></li>
<li><a href="#Page3">Page3</a></li>
<li><a href="#Page4">Page4</a></li>
</ul>
Even though the accepted answer works well, I found the above more natural to Bootstrap.
if you use bs4 simply you can add justify-content-center
class to your nav-tabs to center it on page. if you want your tabs to be justified (full-with) add nav-justified
class to it, in this case if you have 3 items in your nav each of them has 33% with. if 5 items is there each one have 20% with.
another way is simply to add text-center
if you are use bs3 .