Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Need to center a navigation WordPress

  • SOLVED

I can't figure out the CSS to center a navigation. Needing a solution ASAP. Please don't guess at answers as I've already tried various things. This navigation is just the primary nav in WordPress, and the theme is custom by me using Underscores.

[[LINK href="http://primary-wide.oilysites.com/"]]http://primary-wide.oilysites.com/[[/LINK]]

Thanks!

Answers (4)

2016-02-12

Navjot Singh answers:

.wide-navigation .main-navigation ul
{
float: none !important;
margin: 0 20%;
}


Kyler Boudreau comments:

Both solutions worked. Thank you - I apologize for the late reply here. Been slammed.

2016-02-12

Rempty answers:

.wide-navigation .main-navigation ul{
float:none!important;
display:inline-block!important;
text-align: left
}
div.menu-menu-1-container{
text-align:center;
}

2016-02-12

Andrea P answers:

definitely with Rempty here.
;)

2016-02-13

Reigel Gallarde answers:

this will do the trick, plus making sure the sub menu still looks great...
.wide-navigation .main-navigation > div > ul{
text-align:center;
width: 100%;
}
.wide-navigation .main-navigation > div > ul > li {
float: none;
display: inline-block;
}
.wide-navigation .main-navigation > div > ul > li > ul {
text-align: left;
}