• 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

Center sub-menu

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 › General Discussion › Center sub-menu

This topic is: not resolved
  • This topic has 7 replies, 2 voices, and was last updated 10 years, 8 months ago by pruningtogrow.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • March 11, 2016 at 3:25 pm #181233
    pruningtogrow
    Member

    Could someone help me figure out the best way to center my submenu under the parent?

    http://130.74.103.16/alumni_wp/wordpress/

    Thank you!!

    March 12, 2016 at 5:28 pm #181290
    carasmo
    Participant

    Remove the following lines from your CSS:

    
    
    .site-header .genesis-nav-menu .sub-menu a {
    	color: #fff;
    	padding: 14px 16px;
    left: -160%; /* ========== remove this line only  */
    }
    
    .genesis-nav-menu .menu-item:hover > .sub-menu {
    	left: auto; /* ========== remove this line only  */
    	opacity: 1;
        margin: 0 auto; /* ========== remove this line only  */
    }
    
    .genesis-nav-menu .sub-menu {
    	left: -9999px;
    	opacity: 0;
    	position: absolute;
    	-webkit-transition: opacity .4s ease-in-out;
    	-moz-transition:    opacity .4s ease-in-out;
    	-ms-transition:     opacity .4s ease-in-out;
    	-o-transition:      opacity .4s ease-in-out;
    	transition:         opacity .4s ease-in-out;
    	z-index: 999;
    width:900px; /* ========== remove this line only  */
    }
    

    Add these before your media queries

    
    /* ============= add this BEFORE YOUR MEDIA QUERIES Currently you are using global styles and your child menus are messed up on small devices. ========= */
    
    .genesis-nav-menu .menu-item:hover > .sub-menu {
        left: 0;
        opacity: 1;
        display: block;
        width: 100%;
        text-align: center;
        font-size: 0;
    }
    
    .genesis-nav-menu .sub-menu > .menu-item {
        float: none;
        text-align: center;
        display: inline-block;
    }
    
    @media only screen and (max-width: 768px) {
    
        .genesis-nav-menu .sub-menu > .menu-item {
            text-align: left;
        }
    
    }

    Genesis Theme Customization and Help

    March 18, 2016 at 10:10 am #181798
    pruningtogrow
    Member

    Oh. My. Goodness.
    I can't thank you enough. Thank you so much!!! This worked perfectly! Sorry, I missed this reply earlier.

    March 18, 2016 at 10:12 am #181799
    pruningtogrow
    Member

    Also, I was planning on using a hamburger menu for smaller devices.

    March 18, 2016 at 10:20 am #181801
    pruningtogrow
    Member

    Do you mind if I ask what
    font-size: 0;
    achieves?

    March 18, 2016 at 2:11 pm #181815
    carasmo
    Participant

    It closes the gap made by white space in the html:

    https://css-tricks.com/fighting-the-space-between-inline-block-elements/


    Genesis Theme Customization and Help

    March 18, 2016 at 2:14 pm #181816
    carasmo
    Participant

    If you have additional questions, start a new thread. If your question is CSS based so you should check other resources, not everyone here is very advanced with CSS and I am visiting this forum less often.


    Genesis Theme Customization and Help

    March 18, 2016 at 2:33 pm #181819
    pruningtogrow
    Member

    Ok, thanks again for your help. I so appreciate it!

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘General Discussion’ 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

© 2026 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