WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Can't center-align navigation menu in theme Mystile (3 posts)

  1. allihop
    Member
    Posted 9 months ago #

    Hi,

    Site: http://www.allihop.dk

    I have successfully centered the main nav menu by creating a "Child theme" and adding the following in a style.css file:

    /*
     Theme Name:     Mystile Child
     Theme URI:      http://example.com/twenty-thirteen-child/
     Description:    Mystile Theme
     Author:         None
     Author URI:     http://example.com
     Template:       mystile
     Version:        1.0.0
    */
    
    /* =Imports styles from the parent theme
    -------------------------------------------------------------- */
    @import url('../mystile/style.css');
    
    /* =Theme customization starts here
    -------------------------------------------------------------- */
    #header hgroup {
        float: none !important;
        text-align: center;
    }
    
    #header #logo {
        float: none;
    }
    
    #header #navigation,
    #header #navigation ul.nav {
        float: none !important;
    }
    
    #header #navigation {
        margin: 0 auto !important;
    }
    
    #header .nav-toggle {
        position: relative;
        margin-left: auto;
        margin-right: auto;
    }

    This worked just fine from the start, but now the menu is again aligned to the left. I have fiddled around in the css sheets on main theme and perhaps i have come to undo something...

    I also have added the following in main themse "custom.css" file:

    /* Desktop styles go here */
    @media only screen and (min-width: 767px) {
        #primary-menu ul {
            display: table !important;
    
       }
    }

    Thanks in advance,

    //Daniel

  2. allihop
    Member
    Posted 9 months ago #

    Solved it by overwrite existing 'style.css' in theme Mystile folder + overwrite the optional theme style 'red.css'. By using "new" .css files in order to remove any "fiddle" from my side.

    Clear chache and update browser - it's there again, centered as it should be.

  3. joshua.plays
    Member
    Posted 6 months ago #

    I am trying all these codes, and still can't get my NAV to center...any thoughts?

Reply

You must log in to post.

About this Topic

Tags

No tags yet.