CSS中心子菜单Wordpress [英] CSS Center Submenu Wordpress

查看:105
本文介绍了CSS中心子菜单Wordpress的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi需要将我的1000像素宽度的子菜单放在页面中。

Hi Need to center my 1000px width submenu to the page.

我相信我的问题在于:

    position: absolute;
    top: 23px;
    left: 50%;

网站是: http://dev.timson.me (关于即将到来和过去制作的子菜单)

The website is: http://dev.timson.me (Submenus on "Upcoming" & "Past Productions")

CSS是:

#access {
    clear: both;
    display: block;
    float: left;
    margin: 0 auto 6px;
    padding-top: 8px;
    width: 100%;
    font-family: Stag;
    display:block;
    text-align:center;
}

#access ul {
    font-size: 13px;
    list-style: none;
    margin: 0 0 0 -0.8125em;
    padding-left: 0;

    display:inline-block;
}

.sub-menu {
    text-align: center;
}

#menu-default > li {
    float: left;
    position: relative;
}
.sub-menu > li {
    display: inline-block;
}

#access a {
    color: #eee;
    display: block;
    line-height: 25px;
    margin-top: -4px;
    margin-bottom: -4px;
    padding: 0 1.2125em;
    text-decoration: none;
}

#access ul ul {

    display: none;
    float: left;
    margin-top: 0;
    position: absolute;
    top: 23px;
    left: 50%;
    width: 1000px;
    z-index: 99999;
    margin-left:-500px;
    text-align:center;
    padding-top:5px;
    padding-bottom:10px;

    background: red;
}

#access ul ul a {

    margin-top: 0px;
    margin-right: auto;
    margin-bottom: 0px;
    margin-left: auto;
    padding-bottom:10px;

}

#access ul li:hover > ul {
    display: block;
}

非常感谢任何帮助。

干脆,
彼得

推荐答案

尝试移除 position:relative; / code>从您的主导航#menu-default> li 并将 #access ul

这篇关于CSS中心子菜单Wordpress的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆