WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to center menu in Twenty Ten theme? (10 posts)

  1. carlosgonca
    Member
    Posted 4 years ago #

    I try to center with known "margin: 0px auto;" but didn´t do any effect to my menu. How can I fix it?

    Thanks a lot!

  2. jdivosevic
    Member
    Posted 4 years ago #

    Did you ever figure this out? Trying to center my menu bar on the page as well

  3. Isparkleen
    Member
    Posted 4 years ago #

    Same here. In my case, I want to align it to the right.

  4. Izvarinskij
    Member
    Posted 4 years ago #

    .menu{ text-align:center; }
    .menu ul{ display:inline-block; }

    for IE6 and IE7 also add (recommend to do it in separate file)

    .menu ul{
        display:inline;
        zoom:1;
    }

    You may also add display:-moz-inline-stack for Firefox 2, but I wouldn’t care, because almost nobody use that old version these days, and centered menu is not critical (it will be left-aligned in Fx 2)

    Another solution
    You may also manually move menu with margin-left, however you would need to readjust it every time you add/remove links on nav. bar.

    @Isparkleen, you just need to add

    .menu ul{
        float:right;
        position:relative;
        right:12px;
    }
  5. sara cannon
    Member
    Posted 4 years ago #

    we're talking about twentyten. so, do you mean in

    #access .menu-header,
    div.menu {
    	text-align:center;
    }

    and

    #access .menu-header ul,
    div.menu ul {
    		display:inline-block;
    }

    because that doesn't work really. it leaves the menus in the drop-down position.

    I'm going to work on this and get back to y'all unless I misunderstood.

  6. carlosgonca
    Member
    Posted 4 years ago #

    Izvarinskij, works for me! Thanks a lot for your solution.

    Saracannon, for me I had to put like this:

    #access {
    display:block;
    z-index:999;
    position:absolute;
    text-align:center;
    }

    #access ul{display:inline-block;}

  7. sara cannon
    Member
    Posted 4 years ago #

    thanks carlosgonca! that works for me too.

  8. Trollkjeft
    Member
    Posted 3 years ago #

    @Izvarinskij - could you please explain further how you make it work in IE?

    I've added:

    .menu ul{
        display:inline;
        zoom:1;
    }

    But it wont work in IE.

  9. Trollkjeft
    Member
    Posted 3 years ago #

    Sorry, I got it to work. Thanks anyway!

  10. alexrams
    Member
    Posted 3 years ago #

    Hey.

    Anyone who knows how I can allign the text in the menu. I want to center the text inside the rollover effect. Now it's positioned right and I can figure how to center it

    Alex

Topic Closed

This topic has been closed to new replies.

About this Topic