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

  1. allihop
    Posted 2 years ago #


    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,


  2. allihop
    Posted 2 years 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
    Posted 2 years ago #

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

  4. carolinacolon
    Posted 1 year ago #

    ugh seriously been trying to center my nav for hours.
    tried all the above.
    need help (or a miracle)

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.