WordPress.org

Forums

Pinboard
[resolved] Want to Centre the navigation Bar (4 posts)

  1. dinnaila
    Member
    Posted 2 years ago #

    I am trying to make my navigation bar at the top central - can anyone help please.

    http://naila.me.uk/

  2. davidgabunia
    Member
    Posted 2 years ago #

    Here is what you have to add to your CSS:

    div.menu-main-container {
    margin-left:auto;
    margin-right:auto;
    width:667px;
    }

  3. davidgabunia
    Member
    Posted 2 years ago #

    The width depends on YOUR nav container. 667px is just an example. And don’t forget to adjust this number as you add or delete navigation topics.

  4. Andrew
    Forum moderator
    Posted 2 years ago #

    Although this has been asked and answered many times before;

    You can try this;

    #access {
     padding: 0;
    }
    
    #access ul {
     display: table;
     margin: 0 auto;
     float: none;
    }

    Try using a browser developer tool for this kind of exploratory CSS work.
    I use Google Chrome's built-in Developer Tool because I find it particularly easy to use.

    Alternatively, ask general CSS forums;
    http://csscreator.com/forum
    http://www.cssforum.com.pk/
    http://css-tricks.com/forums/
    http://www.welovecss.com/
    http://www.codingforums.com/

    Now that you know the style, from being exposed/added by the Developer Tool, you can add a new style to override it.

    You ought to add new styles externally, not within the theme's files. Changes to the theme's files will compromise the theme and be compromised when the theme updates.

    External changes can be made using a Child Theme or through a plugin that provides Custom CSS functionality.

    I recommend using the Jetpack plugin and its Custom CSS functionality to hold your CSS modifications.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic