我找不到将其居中的方法。

http://milassoforlerodasi.org.tr/

我的CSS代码如下所示:

/* First Level - Menu Secondary */
.menu-secondary li a {
    color: #FFFFFF;
    padding: 14px 3px 13px 15px;
    text-decoration: none;
    font-family: 'Gentium+Basic', sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    font-weight: bold;
}

.menu-secondary li a:hover, .menu-secondary li a:active, .menu-secondary li a:focus,
.menu-secondary li:hover > a, .menu-secondary li.current-cat > a, .menu-secondary li.current_page_item > a, .menu-secondary li.current-menu-item > a {
    color: #000000;
    background:#FFFFFF;
    outline: 0;
}

/* Child Levels - Menu Secondary */

.menu-secondary li li a {
    color: #FFFFFF;
    background: #000000;
    padding: 10px 15px;
    text-transform: none;
    margin: 0;
    font-weight: normal;
}

.menu-secondary li li a:hover, .menu-secondary li li a:active, .menu-secondary li li a:focus,
.menu-secondary li li:hover > a, .menu-secondary li li.current-cat > a, .menu-secondary li li.current_page_item > a, .menu-secondary li li.current-menu-item > a {
    color: #FFFFFF;
    background: #22AEEF;
    outline: 0;
}

/* Arrows - Menu Secondary */

.menu-secondary a.sf-with-ul {
    padding-right: 26px;
    min-width: 1px;
}
.menu-secondary  .sf-sub-indicator {
    position: absolute;
    display: block;
    overflow: hidden;
    right: 0;
    top:  0;
    padding: 13px 13px 0 0;
}

.menu-secondary li li .sf-sub-indicator {

    padding: 9px 13px 0 0;
}

/* Shadows - Menu Secondary */

.wrap-menu-secondary .sf-shadow ul {
    background: url('images/menu-secondary-shadow.png') no-repeat bottom right;
}


我在.menu-secondary li a中插入了许多不同的代码,但没有一个真正使文本和链接居中。

最佳答案

好吧,我现在收到你的问题了。

clearfix元素中添加一个类#menu-secondary-menu
然后添加此CSS:

#menu-secondary-menu {
  display: table;
  margin: 0 auto;
}


它应该做的工作。

关于css - 我无法在wp主题的菜单上居中显示文本,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/28525477/

10-11 05:16
查看更多