WordPress.org

Ready to get started?Download WordPress

Forums

Centering a menu css (4 posts)

  1. chris-babww
    Member
    Posted 2 years ago #

    Hello,
    I've got a strange problem.

    I can't center a menu in wordpress. I can't believe it!!!

    Here is the code:

    <nav>
        <div id="nav">
    	<div class="menu-english-container">
               <ul id="menu-english" class="menu">
                   <li id="menu-item-375" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-5 current_page_item menu-item-375">
                       <a href="http://chateaucazine.com/">Menu 1</a>
                   </li>
                   <li id="menu-item-375" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-5 current_page_item menu-item-375">
                       <a href="http://chateaucazine.com/">Menu 2</a>
                   </li>
                   <li id="menu-item-375" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-5 current_page_item menu-item-375">
                       <a href="http://chateaucazine.com/">Menu 3</a>
                   </li>
        </ul>
    </div>
    </div>
    </nav>

    Here's my css:

    [CSS code above the forum limit of 10 lines moderated - just post a link to your site]

    Please help me because I'm going crazy with it!!!

  2. Phil
    Member
    Posted 2 years ago #

    Link to site?

  3. BillyShiels
    Member
    Posted 2 years ago #

    <nav style="margin-right:50%;">
    <div id="nav">
    <div class="menu-english-container">
    <ul id="menu-english" class="menu">
    <li id="menu-item-375" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-5 current_page_item menu-item-375">
    Menu 1

    <li id="menu-item-375" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-5 current_page_item menu-item-375">
    Menu 2

    <li id="menu-item-375" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-5 current_page_item menu-item-375">
    Menu 3

    </div>
    </div>
    </nav>

    Hi Chris I tried this by it shifted the menu to the center, I don't know if it'll be of any use to you, I added a style="margin-right:50%;" to the nav tag.

  4. chris-babww
    Member
    Posted 2 years ago #

    ahah sorry display: inline-block was missing. I'm so stupid...

Topic Closed

This topic has been closed to new replies.

About this Topic