gpt4 book ai didi

css - 我的下 zipper 接旁边有 10 像素的透明空间

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

我目前正在处理我的导航栏。我遇到的一个问题是,当我向主导航 .navi ul 添加 10px 的填充时,每个菜单项下的所有下拉项都添加了 10px 的空白空间,我就是做不到找出原因。你可以在这里看到这个:http://cbchaverhill.onedirectionconnection.com/

这是我的 CSS:

.navi {
background: #222; /* Show a solid color for older browsers */
background: -moz-linear-gradient(#252525, #0a0a0a);
background: -o-linear-gradient(#252525, #0a0a0a);
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#252525), to(#0a0a0a)); /* older webkit syntax */
background: -webkit-linear-gradient(#252525, #0a0a0a);
clear: both;
display: block;
float: left;
margin: 0 auto 6px;
width: 100%;
}

.navi ul {
font-size: 13px;
list-style: none;
margin: 0 0 0 -0.8125em;
padding-left: 10px;
}

.navi li {
float: left;
position: relative;
}

.navi a {
color: #eee;
display: block;
line-height: 3.333em;
padding: 0 1.2125em;
text-decoration: none;
font-weight: bold;
}

.navi ul ul {
-moz-box-shadow: 0 3px 3px rgba(0,0,0,0.2);
-webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.2);
box-shadow: 0 3px 3px rgba(0,0,0,0.2);
display: none;
float: left;
margin: 0;
position: absolute;
top: 3.333em;
left: 0;
width: 188px;
z-index: 99999;
}

.navi ul ul ul {
left: 100%;
top: 0;
}

.navi ul ul a {
background: #f9f9f9;
border-bottom: 1px dotted #ddd; color: #444;
font-size: 13px;
font-weight: normal;
height: auto;
line-height: 1.4em;
padding: 10px 10px;
width: 188px;
}

.navi li:hover > a,
.navi ul ul :hover > a,
.navi a:focus {
background: #efefef;
}

.navi li:hover > a,
.navi a:focus {
background: #f9f9f9; /* Show a solid color for older browsers */
background: -moz-linear-gradient(#f9f9f9, #e5e5e5);
background: -o-linear-gradient(#f9f9f9, #e5e5e5);
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f9f9f9), to(#e5e5e5)); /* Older webkit syntax */
background: -webkit-linear-gradient(#f9f9f9, #e5e5e5);
color: #373737;
}

.navi ul li:hover > ul {
display: block;
}

.navi
.current-menu-item > a,
.navi .current-menu-ancestor > a,
.navi .current_page_item > a,
.navi .current_page_ancestor > a {
font-weight: bold;
}

如有任何帮助,我们将不胜感激!

最佳答案

应用于 .navi ul 的 css 也适用于嵌套的 ul

.navi ul {
padding-left: 10px;
}

解决这个问题的一种方法:

.navi ul ul {
padding-left: 0px;
}

或者:

.navi ul {
font-size: 13px;
list-style: none;
margin: 0 0 0 0;
}

关于css - 我的下 zipper 接旁边有 10 像素的透明空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21492894/

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