垂直WP Nav菜单不是所有
  • 元素的中心,只是一些
  • 问题描述:

    This one doesn't make a lot of sense to me, but perhaps I'm overlooking something obvious. Here it goes:

    Im working with a Wordpress theme called Size Mttrs that I already modified pretty heavily. The issue I'm having is the navigation menu wont center all the list elements (or navigation links). I applied text-align:center to #sidebar a{} and this centered all of my navigation links properly... Except for two of them ("contacts" and "properties"). These two aren't even at the end or the beginning, they are halfway down the list. I cant imagine why it would center all but those two.

    Id post a picture but this is a new account, and id post a link except for some reason it thinks this is spam.

    This is the CSS for the sidebar (you'll notice i tried applying text-align:center to almost everything):

    #sidebar { width:210px; top:0px;bottom:0px; line-height:18px; position:fixed; height:100%;background:#f0f0f0;padding:20px;text-align:center!important;  }
    .widget-top a,
    #sidebar a { color:#CCC;text-align:center!important; }
    
    
    #sidebar .menu { padding:0; margin:0 0 20px; display:block;border-top:4px solid     #ccc;border-bottom:3px solid #ccc;text-align:center!important; }
    #container.expanded #sidebar .menu a,
    #sidebar .menu a { text-align:center;color:#000; font-weight:400;font- style:none;display:block;letter-spacing:2px; padding:10px 50px;font-size:1.3em;font-family:   'PTSansRegular', 'ChanticleerRomanRegular', Palatino, serif!important;border-bottom:1px  solid #ccc; text-transform:uppercase; }
    #sidebar .menu a:hover {font-weight:800!important}
    #sidebar .menu li { margin-bottom:0!important;text-align:center!important; }
    #sidebar .menu .sub-menu { display:none; margin-left:10px }
    #sidebar .menu .sub-menu a { font-weight:normal; padding:5px 0; font-size:100% }
    #sidebar .sub-menu ul { border-left:0; }
    #sidebar .drop-menu:after { content:""; display:block; float:right; width:11px; height:11px; overflow:hidden; background-position:-122px 0; margin:3px 0 0 0 }
    #sidebar .drop-menu:hover:after { background-position:-122px -16px }
    #sidebar .drop-menu.open:after { background-position:-134px 0 }
    #sidebar .drop-menu.open:hover:after { background-position:-134px -16px }
    #sidebar input[type=text], .textfield { background:#282a2d; color:#666; border:3px solid #222326; -webkit-box-shadow:inset 0px 1px 1px rgba(0,0,0,0.5); -moz-box-shadow:inset 0px 1px 1px rgba(0,0,0,0.5); box-shadow:inset 0px 1px 1px rgba(0,0,0,0.5) }
    #sidebar input[type=text]:focus, .textfield:focus { color:#1f1f1f }
    

    This is the HTML output:

    <div id="nav_menu-3" class="widget widget_nav_menu"><div class="menu-nav-container"><ul  id="menu-nav" class="menu"><li id="menu-item-31" class="menu-item menu-item-type-post_type  menu-item-object-page menu-item-31"><a  href="http://katonacreative.com/bluntzer/wordpress/">Home</a></li>
    <li id="menu-item-89" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-89"><a href="http://katonacreative.com/bluntzer/wordpress/?page_id=87">Fisher Island</a></li>
    <li id="menu-item-102" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-102"><a href="http://katonacreative.com/bluntzer/wordpress/?page_id=101">News</a></li>
    <li id="menu-item-155" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-155"><a href="http://katonacreative.com/bluntzer/wordpress/?page_id=153">Agents</a></li>
    <li id="menu-item-183" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-183"><a href="http://katonacreative.com/bluntzer/wordpress/?page_id=181">Contact</a></li>
    <li id="menu-item-194" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-194"><a href="http://katonacreative.com/bluntzer/wordpress/?page_id=192">Properties</a></li>
    <li id="menu-item-206" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-204 current_page_item menu-item-206"><a href="http://katonacreative.com/bluntzer/wordpress/?page_id=204">Test</a></li>
    <li id="menu-item-202" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-202"><a href="http://bluntzergroup.idxco.com/idx/17612/mapSearch.php">Map Search</a></li>
    </ul></div></div> <span class="separator"><span class="line"></span></span> 
    

    The only thing I can think of is there might be some funky PHP process going on i'm unaware of, possibly to do with the way this theme has the WP NAV setup? Any and all help is welcome.

    take off the left right padding of your style rule for #sidebar .menu a ... should read padding:10px 0 instead of padding:10px 40px