中心导航

问题描述 投票:0回答:1

我已经搜索了论坛,并尝试了许多已经提出的建议,但似乎无法将站点导航居中。

我正在使用可访问CSS的网站构建器,因此我的知识有所限制。我想在整个页面上保持相同的导航宽度,但是我希望实际的导航选择位于居中位置。

没有人有任何建议(最好是简单的建议,因为我真的不知道我在做什么)。这是我的CSS:

  .sf_navigation {
    clear:both;
    margin:0 auto;
    width:auto;
    min-height:38px;
    height:auto!important;
    height:38px;
    font-family:Arial;
    font-size:13px;
    position:relative;
    z-index:1000;
}

.sf_navigation ul {
    margin:0;
    padding:0;
    list-style-type:none;
    height:1%;
}

.sf_navigation ul li {
    margin:0;
    list-style-type:none;
    display:inline;
    float:left;
    position:relative;
}

.sf_navigation ul li a {
    display:block;
    font-weight:700;
    padding:12px 37px 0;
    text-align:center;
    text-decoration:none;
    border-right:solid 0;
    background-repeat:repeat-x;
    height:25px;
    width:auto!important;
    white-space:nowrap;
    width:1%;
}

.sf_navigation ul li a:hover {
    text-decoration:underline;
    background-repeat:repeat-x;
    position:relative;
}

.sf_navigation:after,.sf_navigation ul:after {
    content:".";
    display:block;
    visibility:hidden;
    height:0;
    clear:both;
}

.sf_navigation .widget_header {
    display:none;
}
css navigation center
1个回答
0
投票

将此添加到sf_navigation CSS .sf_navigation { display: table; }

© www.soinside.com 2019 - 2024. All rights reserved.