Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap Center Navbar Items

Tags:

I know I can push navbar items to the left and right, but how would I center them?

text-align:center; 

doesn't work nor any of the other things I thought of.

like image 727
PaulBGD Avatar asked Sep 16 '13 22:09

PaulBGD


People also ask

How do I align navbar content to center in bootstrap 4?

By default, navs are left-aligned, but you can easily change them to center or right aligned. Centered with . justify-content-center : Active.


1 Answers

You will need to modify some CSS rules for Navbar component. So add a class center to nav.navbar and the following rules:

.navbar.center .navbar-inner {     text-align: center; }  .navbar.center .navbar-inner .nav {     display:inline-block;     float: none; } 

Working demo (Bootstrap 3.3.7)

like image 100
letiagoalves Avatar answered Oct 07 '22 08:10

letiagoalves