WordPress.org

Ready to get started?Download WordPress

Forums

Centering Menu Items (Squirrel Theme) (6 posts)

  1. RHemingway
    Member
    Posted 1 year ago #

    Hi all,

    I am trying to center the menu items in the Squirrel website theme at wholesale used books.

    I removed the float: left attriubute but still can't seem to center it.

    CSS is as follows:

    .menu_wrapper {
    margin-bottom:0;
    }
    #menu {
    position:relative;
    z-index:99;
    }
    #menu li {
    list-style-type:none;
    }
    #menu li a {
    font-size:13px;
    margin:0;
    padding:3px 8px;
    position:relative;
    color: #fff;
    text-align:center;
    text-decoration:none;
    text-transform:uppercase;
    }

    Thanks for your help!

    Richard

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    Consider this article on Centering Things, but generally CSS support this specific is not supported from WordPress forums and ought to be asked in CSS-specific forums.

  3. RHemingway
    Member
    Posted 1 year ago #

    Thanks for this Andrew,

    Have attempted to implement some changes based on the CSS article but no joy at present.

    I had seen a few other posts on the forums before posting this one covering similar problems, but none of the suggestions worked for me.

  4. Ivo Delin
    Member
    Posted 1 year ago #

    #menu {
    text-align: center;
    }
    #menu li {
    float: none;
    display: inline;
    }

  5. RHemingway
    Member
    Posted 1 year ago #

    Thanks Ivo,

    Afraid that didn't work.

    It changed the text to black & all items in the dropdown displayed as bullet points. All remained aligned to the left.

  6. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    There's not an easy or simple way to do what you want -- probably the best way, unless you want to do major recoding of that section of the page, is to change the padding-left in this CSS:

    #menu .ddsmoothmenu {
        background: none repeat scroll 0 0 #373737;
        float: left;
        padding-bottom: 5px;
        padding-left: 150px;
        width: 950px;

    You'll have to adjust it if you add any other menu items. It's also not recommended to make changes in any theme files -- but to rather use a child theme or custom CSS option or plug-in.

Topic Closed

This topic has been closed to new replies.

About this Topic