Community Forums › Forums › Archived Forums › Design Tips and Tricks › Please Help! Center the Menu options on the Nav. Bar
Tagged: balance theme, center menu items, menu CSS
- This topic has 9 replies, 4 voices, and was last updated 11 years, 10 months ago by
John.
-
AuthorPosts
-
December 13, 2012 at 7:56 pm #5126
CourtneyTU
MemberI feel like i'm searching for a needle in a haystack...can someone please point me to the css code where I would be able to place the menu items on my navigation bar in the CENTER instead of the left?
Courtneydevon.com
Thanks!
December 13, 2012 at 8:48 pm #5134John
ParticipantCourtney,
Adding this to your style.css should do the trick:
.menu-primary {
text-align: center;
}
.menu-primary li {
display: inline-block;
float: none;
}John
John Sundberg | blackhillswebworks.com
A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉January 22, 2013 at 4:01 am #13676PhilMurray
Participanthi John
sorry i tried adding your code to the stylesheet but didn't seem to work - any ideas?
demo site is here
thanks
Phil
January 22, 2013 at 7:06 am #13689John
ParticipantHi Phil,
In line 310 of your style.css change the float:left to this:
.menu-primary li,
.menu-secondary li,
#header .menu li {
float: none;
list-style-type: none;
}Or just add it to the end of your style.css file.
John
John Sundberg | blackhillswebworks.com
A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉January 22, 2013 at 7:33 am #13694PhilMurray
Participantbrilliant John - worked a treat!
thanks again
Phil
January 22, 2013 at 10:15 am #13717John
ParticipantYou're welcome!
John Sundberg | blackhillswebworks.com
A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉January 21, 2014 at 8:37 am #86270valmistaudu
MemberHello,
Im facing the same problem with modern portfolio pro. I would like to center the main navigation bar. This code and a few other tips haven't worked. Could you please help? 🙂
Another issue I'm having is that...I would like the menus hover color (in this case the green) to stay green when in current page. Any tips?
Thanks
January 21, 2014 at 2:50 pm #86318John
Participantvalmistaudu,
This should center your main navigation:
.nav-primary .genesis-nav-menu.menu-primary { text-align: center; }For the current page menu item, change line 1054 from this
.genesis-nav-menu a:hover, .genesis-nav-menu .sub-menu .current-menu-item > a:hover { background-color: #80c053; color: #80c053; }to this
.genesis-nav-menu a:hover, .genesis-nav-menu .sub-menu .current-menu-item > a:hover, .genesis-nav-menu.menu-primary .current-menu-item a { background-color: #80c053; color: #fff; }John
John Sundberg | blackhillswebworks.com
A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉January 22, 2014 at 4:19 am #86417valmistaudu
MemberAwesome! worked perfectly.
Thank you.
January 22, 2014 at 7:17 am #86431John
ParticipantYou're welcome! Glad it worked.
John Sundberg | blackhillswebworks.com
A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉 -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.