我正在尝试修复wordpress website上的子菜单。
下面是CSS,我只是不确定要进行哪些更改才能使两者连接!我试过一点数字,似乎没有任何效果。我已将所有内容恢复为“正常”状态,因此第二只眼睛会很棒。以下是我的网站中使用的CSS。
.navi-wrap ul {
list-style: none;
padding: 0;
}
.navi-wrap li {
display: inline-block;
position: relative;
}
.navi-wrap ul li {
}
.navi-wrap li a {
color: #555555;
font-size: 10px;
display: block;
line-height: .5em;
padding: 0 10px 0 15px;
text-transform: uppercase;
letter-spacing: .2em;
text-decoration: none;
}
.navi-wrap li a:hover {
color: #aaaaaa;
line-height: 1.5em;
}
.navi-wrap li:last-child {
color: #aaaaaa;
font-size: 0px;
padding: 0;
}
.navi-wrap li:hover > a,
.navi-wrap ul ul :hover > a,
.navi-wrap .current-menu-item > a,
.navi-wrap .current-menu-ancestor > a,
.navi-wrap .current_page_item > a,
.navi-wrap .current_page_ancestor > a {
background-repeat: no-repeat;
background-position: 50% 0%;
}
.navi-wrap li ul {
position: absolute;
left: -9999px;
height: auto;
width: 180px;
text-align: left;
z-index: 999;
color: #404040;
margin: 5px 0 0 0;
display: block;
*display: none;
background-color: #e3e3e3;
}
.navi-wrap li li {
width: 180px;
z-index: 999;
float: left;
margin: 0px;
font-size: 10px;
text-align: left;
color: #555555;
display: block;
min-height: 12px;
background-color: #e3e3e3;
}
.navi-wrap ul li li:hover {
font-size: 10px;
background-color: #aaaaaa;
color: #555555 !important;
}
.navi-wrap li li:last-child {
color: #25262b;
font-size:11px;
}
.navi-wrap li li:after {
display: none;
}
.navi-wrap li li {
padding: 0px;
}
.navi-wrap li li a {
font-size:10px;
color: #404040;
display: block;
padding: 18px 5px 15px 10px;
text-align: left;
}
.navi-wrap li li a:hover {
background-color: #888888;
border: none;
}
.navi-wrap li li ul {
display: none;
}
.navi-wrap li:hover ul, .navi-wrap li li:hover ul, .navi-wrap li li li:hover ul, .navi-wrap li.sfhover ul, .navi-wrap li li.sfhover ul, .navi-wrap li li li.sfhover ul {
left: auto;
}
.menu-item {
margin: 0 -2px;
}
.navi-wrap:first-child {
}
答案 0 :(得分:0)
您已为孩子margin-top
添加了ul
。您需要删除顶部保证金。而是添加填充。如下所示。
ul.children {
padding-top: 5px;
margin-top: 0;
}