gpt4 book ai didi

css - 导航中心

转载 作者:太空宇宙 更新时间:2023-11-04 04:28:54 25 4
gpt4 key购买 nike

我似乎无法弄清楚如何让绝对居中的 Logo 被我的导航链接包围(每边 3 个),以及如何让导航在调整大小时低于 Logo ,参见此处:http://testsite.brentthelendesign.com/ .如果在其他地方回答了这个问题,我提前道歉。任何帮助将不胜感激!

代码如下:

Logo CSS

h1.logo {
    float: none;
    left: 50%;
    margin-left: -80px;
    text-align: center;
}

h1.logo a {
    background: url("images/logo.png") no-repeat scroll 0 0 transparent;
    display: block;
    float: none;
    height: 127px;
    text-align: center;
    text-indent: -9999px;
    width: 181px;
}

.abs {
    position: absolute;
}

导航 CSS

.nav {
    position: relative;
}
#navigation ul li, #navigation ul li a {
    border: medium none !important;
    color: #3C3F40;
    display: block;
    float: right;
    font-family: 'Fjord One',"Times New Roman",Times,serif;
    font-weight: normal;
    margin: 42px 0 130px !important;
    padding: 15px 25px;
    position: relative;
    text-align: center !important;
    text-decoration: none;
    text-transform: uppercase;
}
#navigation ul li:hover a, #navigation ul li a:hover {
    color: #D9A13B;
}
#navigation ul li:hover li a {
    color: #D9A13B;
    font-weight: normal;
}
#navigation ul li.active a {
    color: #D9A13B;
}
#navigation ul.sub-menu {

}
#navigation ul.sub-menu li {
    border: medium none;
}
#navigation ul.sub-menu li a {
    background: none repeat scroll 0 0 transparent;
    border-bottom: medium none;
    border-radius: 0 0 0 0;
    height: 32px;
    line-height: 32px;
    min-width: 210px;
    padding: 5px 0 5px 8px;
    position: static;
}
#navigation ul.sub-menu li a:hover {
    border-bottom: medium none;
}

HTML:

<header class="sixteen columns">



<nav>

<h1 class="logo abs">
<a href="/">Bound By Design</a>
</h1>

<div id="navigation" class="row sixteen columns">
<div class="menu-header">

<ul id="menu-primary-menu" class="menu sf-js-enabled">

<li id="menu-item-40" class="menu-item menu-item-type-post_type menu-item-
object-page current-menu-item page_item page-item-4 current_page_item menu-item-40 active">
<a href="http://testsite.brentthelendesign.com/">Home</a>
</li>
<li id="menu-item-41" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-41">
<a href="http://testsite.brentthelendesign.com/category/tattoos/">Tattoos</a>
</li>
<li id="menu-item-42" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-42">
<a href="http://testsite.brentthelendesign.com/category/piercings/">Piercings</a>
</li>
<li id="menu-item-60" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-60">
<a href="http://testsite.brentthelendesign.com/aftercare/">Aftercare</a>
</li>
<li id="menu-item-58" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-58">
<a href="http://testsite.brentthelendesign.com/category/news/">News</a>
</li>
<li id="menu-item-59" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-59">
<a href="http://testsite.brentthelendesign.com/contact/">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
</header>

最佳答案

只需添加:

#navigation ul li:nth-child(3) {
margin-right: 213px!important;
}

到 layout.css ,它会处理 Logo 问题。

还有:

#navigation ul li, #navigation ul li a { 15px 0 26px 0 !important; }

将摆脱导航和“欢迎”之间的差距

关于css - 导航中心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17704746/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com