• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Please Help! Center the Menu options on the Nav. Bar

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Please Help! Center the Menu options on the Nav. Bar

This topic is: not resolved

Tagged: balance theme, center menu items, menu CSS

  • This topic has 9 replies, 4 voices, and was last updated 8 years, 3 months ago by John.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • December 13, 2012 at 7:56 pm #5126
    CourtneyTU
    Member

    I 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 #5134
    John
    Participant

    Courtney,

    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 #13676
    PhilMurray
    Participant

    hi 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 #13689
    John
    Participant

    Hi 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 #13694
    PhilMurray
    Participant

    brilliant John - worked a treat!

    thanks again

    Phil

    January 22, 2013 at 10:15 am #13717
    John
    Participant

    You're welcome!


    John Sundberg | blackhillswebworks.com
    A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉

    January 21, 2014 at 8:37 am #86270
    valmistaudu
    Member

    Hello,

    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

    http://www.valmistaudu.fi/genesis

    January 21, 2014 at 2:50 pm #86318
    John
    Participant

    valmistaudu,

    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 #86417
    valmistaudu
    Member

    Awesome! worked perfectly.

    Thank you.

    January 22, 2014 at 7:17 am #86431
    John
    Participant

    You're welcome! Glad it worked.


    John Sundberg | blackhillswebworks.com
    A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉

  • Author
    Posts
Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2022 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble