我正在使用wordpress创建网站。 (可以在此处看到:http://www.adp-design-demos.com/brolim2/)但是,菜单与浏览器的侧面对齐,而不是与我的wordpress网站的内容对齐。我已经遍历了CSS,并且知道菜单CSS的位置,但是目前我所要做的只是按百分比移动它。

任何人都可以帮助我进行编码,以便菜单显示在固定位置,而不管窗口/浏览器的大小和位置如何。

干杯

我一直在编辑的区域:

#header .nav {
    background: #E0DCD9 url('images/bg_nav.png') repeat-x;
    overflow: hidden;
}
#header .nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}
#header .nav li {
    float: left;
}
#header .nav li a {
    display: block;
    padding: 12px 18px 13px 18px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
}

    #header .nav li ul {
        margin: 0;
        padding: 0;
        position: absolute;
        margin-top: 26px;
    }

    #header .nav li li a {
        font-size: 11px;
        padding: 0;
        margin: 0 0 0 20px;
    }
    #header .nav li li {
        width: auto;
        display: inline;
        float: none;
    }
    #header .nav li li a:hover {
        background: none;
    }

#header .nav li a:hover, #header .nav .current_page_item a {
    background: #4B3F33;
    color: #fff;
}
#header .nav li ul {
    display: none;
}
#header .nav .current_page_item ul {
    display: block;
    position: absolute;
    left: 652px;
}
#header .nav .current_page_item ul li a {
    background: none;
    color: #666;
}

.nav_categories {
    background: #f58220;
    background-position: top center;
    overflow: hidden;

}
.nav_categories ul {
    width: 1000px;
    margin: 0 auto 0 auto;
}
.nav_categories a {
    display: block;
    padding: 15px;
align: center;
    font-size: 15px;
    font-weight: bold;
    text-transform: uppercase;

    color: #fff;
}
.nav_categories li {
    float:right;
 position:relative;
 left:-42%;
 text-align:left;
}
.nav_categories .current-cat a, .nav_categories a:hover {
    color: #4b3f33;
}

最佳答案

乍一看,导航的对齐方式看起来正确(即使在调整大小之后)。我查看了演示站点并检查了html。我在#header中找不到.nav。您可以向我提供您正在使用的html吗?

关于css - 我的菜单与浏览器窗口对齐,而不是内容对齐,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7080851/

10-11 22:26
查看更多